NOTE: PROCEDURE PRINTTO used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

4    
5    
6    %global projectrootdirectory;
7    %let projectrootdirectory = C:/Users/hpham13/Projects/mf_activism/empirical;
8    
9    /* Create local libraries */
10   libname rawdata "&projectrootdirectory./0_input/original";
NOTE: Libref RAWDATA was successfully assigned as follows: 
      Engine:        V9 
      Physical Name: C:\Users\hpham13\Projects\mf_activism\empirical\0_input\original
11   libname save    "&projectrootdirectory./1_code/final_package_acceptance";
NOTE: Libref SAVE was successfully assigned as follows: 
      Engine:        V9 
      Physical Name: 
      C:\Users\hpham13\Projects\mf_activism\empirical\1_code\final_package_acceptance
12   libname data    "C:/Users/hpham13/Projects/mutualfund/empirical/0_inputs/mfdb/Data/Original"
12 ! ;
NOTE: Libref DATA was successfully assigned as follows: 
      Engine:        V9 
      Physical Name: C:\Users\hpham13\Projects\mutualfund\empirical\0_inputs\mfdb\Data\Original
13   
14   %global datadirectory;
15   %let datadirectory = C:/Users/hpham13/Data;
16   
17   libname lnk      "&datadirectory./Linking_tables/";
NOTE: Libref LNK was successfully assigned as follows: 
      Engine:        V9 
      Physical Name: C:\Users\hpham13\Data\Linking_tables
18   libname ceo      "&datadirectory./ceo/";
NOTE: Libref CEO was successfully assigned as follows: 
      Engine:        V9 
      Physical Name: C:\Users\hpham13\Data\ceo
19   libname activism "&datadirectory./activism/";
NOTE: Libref ACTIVISM was successfully assigned as follows: 
      Engine:        V9 
      Physical Name: C:\Users\hpham13\Data\activism
20   libname comp     "&datadirectory./compustat/fundq/";
NOTE: Libref COMP was successfully assigned as follows: 
      Engine:        V9 
      Physical Name: C:\Users\hpham13\Data\compustat\fundq
21   libname crsp     "&datadirectory./crsp/";
NOTE: Libref CRSP was successfully assigned as follows: 
      Engine:        V9 
      Physical Name: C:\Users\hpham13\Data\crsp
22   libname tr       "&datadirectory./ThomsonReuters/s12";
NOTE: Libref TR was successfully assigned as follows: 
      Engine:        V9 
      Physical Name: C:\Users\hpham13\Data\ThomsonReuters\s12
23   libname lnk      "&datadirectory./Linking_tables";
NOTE: Libref LNK was successfully assigned as follows: 
      Engine:        V9 
      Physical Name: C:\Users\hpham13\Data\Linking_tables
24   libname mfl      "&datadirectory./Linking_tables/mflink2_20230828";
NOTE: Libref MFL was successfully assigned as follows: 
      Engine:        V9 
      Physical Name: C:\Users\hpham13\Data\Linking_tables\mflink2_20230828
25   
26   /* Macros */
27   %include "&datadirectory./utils/do_over.sas";
334  %include "&datadirectory./utils/ff48.sas";
406  %include "&datadirectory./utils/ff49.sas";
479  %include "&datadirectory./utils/ff12.sas";
518  %include "&datadirectory./utils/winsorize.sas";
606   %include "&datadirectory./utils/lags.sas";
785   
786   
787   /* ******************************************************************************** */
788   /* PART 1:  Compute MF holdings "Adjusted Shares Held" from S12 and CRSP     ****** */
789   /* ******************************************************************************** */
790   /* Step 1.1. Specifying Options */
791   %let begdate = 01MAR1995;
792   %let enddate = 31DEC2021;
793   
794   /* Get CRSP Prices, Returns, and Adjustment Factors from MSF Dataset */
795   /* and Since Thomson S12 is Quarterly (FDATE & RDATE), we align CRSP month-end dates */
796   data Price;
797       format QDATE date9. ;
798       set crsp.msf (keep=permno date cfacpr cfacshr shrout prc ret);
NOTE: Data file CRSP.MSF.DATA is in a format that is native to another host, or the file 
      encoding does not match the session encoding. Cross Environment Data Access will be used, 
      which might require additional CPU resources and might reduce performance.
799       by permno date;
800       where date between "&begdate"d and "&enddate"d;
801       QDATE = INTNX('QTR',date,0,'E');
802       DATE = INTNX('MONTH',date,0,'E');
803       TSO=shrout*cfacshr*1000;
804       P  = abs(prc)/cfacpr;
805       P_1= lag(P); if first.permno then P_1=.;
806       ME = P*TSO/1000000;
807       label TSO = "Total Shares Outstanding, Adjusted";
808       label P = "Price at t Period End, Adjusted";
809       label P_1 = "Price at (t-1), Adjusted";
810       label ME = "Market Capitalization, x$1m";
811       if TSO>0; format TSO comma12.0 ret percentn8.2 prc: dollar12.3;
812       drop /*prc*/ cfacpr shrout;
813   run;

NOTE: Division by zero detected at line 804 column 18.
QDATE=31DEC2011 PERMNO=13030 DATE=20111031 PRC=$17.330 RET=C SHROUT=200 CFACPR=0 CFACSHR=0
FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1 _N_=164928
NOTE: Division by zero detected at line 804 column 18.
QDATE=31DEC2011 PERMNO=13030 DATE=20111130 PRC=$17.360 RET=0.17% SHROUT=300 CFACPR=0 CFACSHR=0
FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1 _N_=164929
NOTE: Division by zero detected at line 804 column 18.
QDATE=31DEC2011 PERMNO=13030 DATE=20111231 PRC=$12.160 RET=-29.95% SHROUT=800 CFACPR=0 CFACSHR=0
FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1 _N_=164930
NOTE: Division by zero detected at line 804 column 18.
QDATE=31MAR2012 PERMNO=13030 DATE=20120131 PRC=$6.830 RET=-43.83% SHROUT=2500 CFACPR=0 CFACSHR=0
FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1 _N_=164931
NOTE: Division by zero detected at line 804 column 18.
QDATE=31MAR2012 PERMNO=13030 DATE=20120229 PRC=$5.490 RET=-19.62% SHROUT=19098 CFACPR=0 CFACSHR=0
FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1 _N_=164932
NOTE: Division by zero detected at line 804 column 18.
QDATE=30SEP2004 PERMNO=90298 DATE=20040731 PRC=$11.450 RET=C SHROUT=18279 CFACPR=0 CFACSHR=0
FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1 _N_=2059434
NOTE: Division by zero detected at line 804 column 18.
QDATE=30SEP2004 PERMNO=90298 DATE=20040831 PRC=$11.720 RET=2.36% SHROUT=18279 CFACPR=0 CFACSHR=0
FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1 _N_=2059435
NOTE: Division by zero detected at line 804 column 18.
QDATE=30SEP2004 PERMNO=90298 DATE=20040930 PRC=$15.990 RET=36.43% SHROUT=18279 CFACPR=0 CFACSHR=0
FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1 _N_=2059436
NOTE: Division by zero detected at line 804 column 18.
QDATE=31DEC2004 PERMNO=90298 DATE=20041031 PRC=$17.100 RET=6.94% SHROUT=18279 CFACPR=0 CFACSHR=0
FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1 _N_=2059437
NOTE: Division by zero detected at line 804 column 18.
QDATE=31DEC2004 PERMNO=90298 DATE=20041130 PRC=$22.550 RET=31.87% SHROUT=27831 CFACPR=0 CFACSHR=0
FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1 _N_=2059438
NOTE: Division by zero detected at line 804 column 18.
QDATE=31DEC2004 PERMNO=90298 DATE=20041231 PRC=$16.250 RET=-27.01% SHROUT=27831 CFACPR=0
CFACSHR=0 FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1
_N_=2059439
NOTE: Division by zero detected at line 804 column 18.
QDATE=31MAR2005 PERMNO=90298 DATE=20050131 PRC=$16.890 RET=3.94% SHROUT=27831 CFACPR=0 CFACSHR=0
FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1 _N_=2059440
NOTE: Division by zero detected at line 804 column 18.
QDATE=31MAR2005 PERMNO=90298 DATE=20050228 PRC=$21.670 RET=28.30% SHROUT=27831 CFACPR=0 CFACSHR=0
FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1 _N_=2059441
NOTE: Division by zero detected at line 804 column 18.
QDATE=31MAR2005 PERMNO=90298 DATE=20050331 PRC=$18.550 RET=-13.43% SHROUT=27831 CFACPR=0
CFACSHR=0 FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1
_N_=2059442
NOTE: Division by zero detected at line 804 column 18.
QDATE=30JUN2005 PERMNO=90298 DATE=20050430 PRC=$15.600 RET=-15.90% SHROUT=27831 CFACPR=0
CFACSHR=0 FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1
_N_=2059443
NOTE: Division by zero detected at line 804 column 18.
QDATE=30JUN2005 PERMNO=90298 DATE=20050531 PRC=$15.940 RET=2.18% SHROUT=27831 CFACPR=0 CFACSHR=0
FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1 _N_=2059444
NOTE: Division by zero detected at line 804 column 18.
QDATE=30JUN2005 PERMNO=90298 DATE=20050630 PRC=$15.870 RET=-0.44% SHROUT=27831 CFACPR=0 CFACSHR=0
FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1 _N_=2059445
NOTE: Division by zero detected at line 804 column 18.
QDATE=30SEP2005 PERMNO=90298 DATE=20050731 PRC=$15.370 RET=-0.25% SHROUT=27831 CFACPR=0 CFACSHR=0
FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=0 TSO=0 P=. P_1=. ME=. _ERROR_=1 _N_=2059446
NOTE: Division by zero detected at line 804 column 18.
QDATE=30SEP2005 PERMNO=90298 DATE=20050731 PRC=$15.370 RET=-0.25% SHROUT=27831 CFACPR=0 CFACSHR=0
FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=0 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1 _N_=2059447
NOTE: Division by zero detected at line 804 column 18.
WARNING: Limit set by ERRORS= option reached.  Further errors of this type will not be printed.
QDATE=30SEP2005 PERMNO=90298 DATE=20050831 PRC=$15.410 RET=0.26% SHROUT=27831 CFACPR=0 CFACSHR=0
FIRST.PERMNO=0 LAST.PERMNO=0 FIRST.DATE=1 LAST.DATE=1 TSO=0 P=. P_1=. ME=. _ERROR_=1 _N_=2059448
NOTE: Missing values were generated as a result of performing an operation on missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      16861 at 803:15   64195 at 804:10   64195 at 804:18   64851 at 806:11   
NOTE: Mathematical operations could not be performed at the following places. The results of the 
      operations have been set to missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      656 at 804:18   
NOTE: There were 2373587 observations read from the data set CRSP.MSF.
      WHERE (date>='01MAR1995'D and date<='31DEC2021'D);
NOTE: The data set WORK.PRICE has 2340645 observations and 10 variables.
NOTE: DATA statement used (Total process time):
      real time           11.22 seconds
      cpu time            3.48 seconds
      

814   
815   /* Keep Last Monthly Observation for Each quarter */
816   data Price;
817       set Price;
818       by permno qdate date;
819       if last.qdate;
820   run;

NOTE: There were 2340645 observations read from the data set WORK.PRICE.
NOTE: The data set WORK.PRICE has 788968 observations and 10 variables.
NOTE: DATA statement used (Total process time):
      real time           0.17 seconds
      cpu time            0.15 seconds
      

821   
822   /* Get report and vintage dates from Thomson-Reuters Mutual Fund Holdings   */
823   /* Exclude Non-Equity Funds from Holdings data that is reported as of Fiscal Quarter End */
824   /* First, Keep First Vintage with Holdings Data for Each RDATE-FUNDNO */
825   proc sql;
826       create table First_Vint
827       as select distinct intnx("month",rdate,0,"E") as rdate format date9., fdate, fundno
828       from tr.s12type1
829       where ("&begdate"d <= rdate <="&enddate"d and ioc not in (1,5,6,7))
830       group by fundno, intnx("month",rdate,0,"E")
831       having fdate=min(fdate) and max(rdate)=rdate
832       order by fundno, rdate desc;
NOTE: The query requires remerging summary statistics back with the original data.
NOTE: Table WORK.FIRST_VINT created, with 1552309 rows and 3 columns.

833   quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           1.81 seconds
      cpu time            2.26 seconds
      

834   
835   /* Until 2003, funds were only required to disclose their holdings semi-annually        */
836   /* Approximately 60% of funds additionally report quarterly holdings                    */
837   /* Use 6-Months as cut-off for portfolio holding period if the gap btw rdates is large  */
838   data First_Vint; set First_Vint;
839       by fundno descending rdate; format nrdate date9.;
840       nrdate = lag(rdate); if first.fundno then nrdate = intnx("month",rdate,6,"E");
841       nrdate = min(nrdate,intnx("month",rdate,6,"E"));
842   run;

NOTE: There were 1552309 observations read from the data set WORK.FIRST_VINT.
NOTE: The data set WORK.FIRST_VINT has 1552309 observations and 4 variables.
NOTE: DATA statement used (Total process time):
      real time           0.46 seconds
      cpu time            0.43 seconds
      

843   proc sort data=First_Vint nodupkey; by fundno fdate; run;

NOTE: There were 1552309 observations read from the data set WORK.FIRST_VINT.
NOTE: 14 observations with duplicate key values were deleted.
NOTE: The data set WORK.FIRST_VINT has 1552295 observations and 4 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.20 seconds
      cpu time            0.32 seconds
      

844   
845   /* Add WFICN portfolio identifiers from MFLINKS */
846   proc sql;
847       create table First_Vint
848       as select b.wficn, a.*
849       from First_Vint as a, mfl.mflink2 as b
850       where a.fundno=b.fundno and a.fdate=b.fdate and not missing(b.wficn);
WARNING: This CREATE TABLE statement recursively references the target table. A consequence of 
         this is a possible data integrity problem.
NOTE: Table WORK.FIRST_VINT created, with 419694 rows and 5 columns.

851   quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           1.64 seconds
      cpu time            0.48 seconds
      

852   proc sort data=First_Vint nodupkey; by wficn rdate; run;

NOTE: There were 419694 observations read from the data set WORK.FIRST_VINT.
NOTE: 122 observations with duplicate key values were deleted.
NOTE: The data set WORK.FIRST_VINT has 419572 observations and 5 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.07 seconds
      cpu time            0.12 seconds
      

853   
854   /* Add Total Number of S12 Filers During Each Quarter (NumInst) */
855   proc sql undo_policy=none;
856       create table First_Vint
857       as select distinct *, count(fundno) as NumInst
858       from First_Vint
859       group by rdate
860       order by fdate, fundno;
NOTE: The query requires remerging summary statistics back with the original data.
NOTE: Table WORK.FIRST_VINT created, with 419572 rows and 6 columns.

861   quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.29 seconds
      cpu time            0.39 seconds
      

862   
863   /* Extract Holdings data by Merging TR-MF S12type1 and S12type3 Sets    */
864   proc sql;
865       /* quarterly data */
866       create view Holdings
867       as select a.rdate,a.nrdate,a.fdate,a.wficn,a.fundno,a.NumInst,b.cusip,b.shares
868       from First_Vint as a, tr.s12type3 as b
869       where a.fdate=b.fdate and a.fundno=b.fundno;
NOTE: SQL view WORK.HOLDINGS has been defined.
870   
871       /* monthly data */
872       create view Holdings1
873       as select a.rdate,a.nrdate,a.fdate,a.wficn,a.fundno,a.NumInst,b.permno,a.shares
874       from Holdings as a, (select distinct ncusip, permno from rawdata.msenames
875                      where not missing(ncusip)) as b
876       where a.cusip=b.ncusip;
NOTE: SQL view WORK.HOLDINGS1 has been defined.
877   
878       /* quarterly data @ stock level */
879       create table Holdings2
880       as select b.date, a.rdate,a.nrdate,a.wficn,a.fundno,a.permno,a.NumInst,
881           a.shares*b.cfacshr as shares_adj label = "Adjusted Shares Held"
882       from Holdings1 as a, price as b
883       where a.permno=b.permno and a.fdate=b.qdate;
NOTE: Table WORK.HOLDINGS2 created, with 43478321 rows and 8 columns.

884   quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           31.03 seconds
      cpu time            29.31 seconds
      

885   
886   /* Sanity Checks for Duplicates */
887   proc sort
888      data=Holdings2
889      out=MF_Holdings nodupkey;
890      by wficn rdate permno;
891   run;

NOTE: There were 43478321 observations read from the data set WORK.HOLDINGS2.
NOTE: 23 observations with duplicate key values were deleted.
NOTE: The data set WORK.MF_HOLDINGS has 43478298 observations and 8 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           9.02 seconds
      cpu time            20.81 seconds
      

892   
893   
894   /* ******************************************************************************** */
895   /* Part 2:   Make a List of Domestic all-equity funds using CRSP MFDB   *********** */
896   /* ******************************************************************************** */
897   /* Extract CRSP Mutual Funds Performance and Characteristics */
898   /* Merge fraction of portfolio in equity assets with the objective code data */
899   proc sql;
900   create table Fund_Style
901   as select a.crsp_fundno, a.si_obj_cd, a.wbrger_obj_cd, a.policy, a.lipper_class, b.avrcs
902   from crsp.fund_style a left join (select distinct crsp_fundno, sum(per_com)/count(per_com)
902 ! as avrcs
903                                      from data.fund_summary2 group by crsp_fundno) b
904   on a.crsp_fundno=b.crsp_fundno;
NOTE: Table WORK.FUND_STYLE created, with 186445 rows and 6 columns.

905   quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           5.50 seconds
      cpu time            0.81 seconds
      

906   
907   /* Sample Selection, focus on Domestic Equity Mutual Funds */
908   /* for which the holdings data are the most complete and reliable */
909   data Equity_Funds; set Fund_Style;
910   if not missing (Lipper_Class) and lipper_class not in
910 ! ('EIEI','G','LCCE','LCGE','LCVE','MCCE',
911      'MCGE','MCVE','MLCE','MLGE','MLVE','SCCE','SCGE','SCVE') then delete;
912   keep crsp_fundno;
913   run;

NOTE: There were 186445 observations read from the data set WORK.FUND_STYLE.
NOTE: The data set WORK.EQUITY_FUNDS has 87527 observations and 1 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.00 seconds
      

914   
915   data names; set crsp.fund_names (where=(fund_name ne ''));
916       by crsp_fundno;
917       if last.crsp_fundno;
918       keep crsp_fundno fund_name index_fund_flag;
919   run;

NOTE: There were 599342 observations read from the data set CRSP.FUND_NAMES.
      WHERE fund_name not = ' ';
NOTE: The data set WORK.NAMES has 71033 observations and 3 variables.
NOTE: DATA statement used (Total process time):
      real time           0.90 seconds
      cpu time            0.14 seconds
      

920   
921   data funds3; merge Equity_Funds  names;
922       by crsp_fundno;
923   run;

NOTE: There were 87527 observations read from the data set WORK.EQUITY_FUNDS.
NOTE: There were 71033 observations read from the data set WORK.NAMES.
NOTE: The data set WORK.FUNDS3 has 125902 observations and 3 variables.
NOTE: DATA statement used (Total process time):
      real time           0.02 seconds
      cpu time            0.03 seconds
      

924   proc sql;
925       create table funds4 (drop=index_fund_flag) as
926       select * from funds3
927       group by crsp_fundno
928       having count(index_fund_flag) = 0;
NOTE: The query requires remerging summary statistics back with the original data.
NOTE: Table WORK.FUNDS4 created, with 117633 rows and 2 columns.

929   quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.11 seconds
      cpu time            0.10 seconds
      

930   
931   proc sql;
932       create table MF_Port (where=(wficn ne .)) as
933       select distinct b.wficn, a.crsp_fundno
934       from funds4 as a left join mfl.mflink1 as b
935         on a.crsp_fundno=b.crsp_fundno
936       group by b.wficn
937       order by wficn, crsp_fundno;
NOTE: A GROUP BY clause has been discarded because neither the SELECT clause nor the optional 
      HAVING clause of the associated table-expression referenced a summary function.
NOTE: Table WORK.MF_PORT created, with 44775 rows and 2 columns.

938   quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.08 seconds
      cpu time            0.09 seconds
      

939   proc sort data=MF_Port; by wficn; run;

NOTE: Input data set is already sorted, no sorting done.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

940   
941   
942   /* ******************************************************************************** */
943   /* Part 3:   Merge the List of Domestic all-equity funds and Holdings   *********** */
944   /* ******************************************************************************** */
945   /* Merge Mutual Fund Holdings data and All-Equity Funds list */
946   proc sort data=MF_Port; by wficn crsp_fundno; run;

NOTE: Input data set is already sorted, no sorting done.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

947   
948   data MF_merged;
949       merge MF_Holdings(in=a) MF_Port(in=b);
950       by wficn ;
951       if b;
952   run;

NOTE: MERGE statement has more than one data set with repeats of BY values.
NOTE: There were 43478298 observations read from the data set WORK.MF_HOLDINGS.
NOTE: There were 44775 observations read from the data set WORK.MF_PORT.
NOTE: The data set WORK.MF_MERGED has 27792232 observations and 9 variables.
NOTE: DATA statement used (Total process time):
      real time           4.88 seconds
      cpu time            4.53 seconds
      

953   
954   %let md_rdate = (year(rdate)*12 + month(rdate) - 1925*12 - 11);
955   %let qd_rdate = (year(rdate)*4  + qtr(rdate)   - 1925*4);
956   data MF_merged;
957       set MF_merged;
958       md = &md_rdate;
959       qd = &qd_rdate;
960   run;

NOTE: Missing values were generated as a result of performing an operation on missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      11200 at 1:3    11200 at 1:14   11200 at 1:3    11200 at 1:14   
NOTE: There were 27792232 observations read from the data set WORK.MF_MERGED.
NOTE: The data set WORK.MF_MERGED has 27792232 observations and 11 variables.
NOTE: DATA statement used (Total process time):
      real time           7.59 seconds
      cpu time            7.18 seconds
      

961   
962   proc sort
963       data=MF_merged
964       out=MF_merged nodupkey;
965       by wficn rdate permno ;
966   run;

NOTE: There were 27792232 observations read from the data set WORK.MF_MERGED.
NOTE: 8842 observations with duplicate key values were deleted.
NOTE: The data set WORK.MF_MERGED has 27783390 observations and 11 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           6.87 seconds
      cpu time            11.60 seconds
      

967   
968   
969   /* ******************************************************************************** */
970   /* Part 4:   Merge holdings with Fund characteristics ***************************** */
971   /* ******************************************************************************** */
972   proc sort data=MF_Port; by crsp_fundno; run;

NOTE: There were 44775 observations read from the data set WORK.MF_PORT.
NOTE: The data set WORK.MF_PORT has 44775 observations and 2 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.00 seconds
      cpu time            0.01 seconds
      

973   /* Merge list of domestic quity funds with TNA data */
974   data returns1; merge MF_Port (in=in1) data.monthly_tna_ret_nav (drop=mnav);
975         by crsp_fundno;
976         if in1 = 1;
977         if wficn ne .;
978         if mtna < 0 then mtna = .;
979         mtna = mtna + 0;
980         mret = mret + 0;
981         retain tna;
982         if first.crsp_fundno or mtna ne . then tna = mtna;
983         rename caldt=date;
984         drop mtna;
985   run;

NOTE: MERGE statement has more than one data set with repeats of BY values.
NOTE: Missing values were generated as a result of performing an operation on missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      368897 at 979:19   190439 at 980:19   
NOTE: There were 44775 observations read from the data set WORK.MF_PORT.
NOTE: There were 8497746 observations read from the data set DATA.MONTHLY_TNA_RET_NAV.
NOTE: The data set WORK.RETURNS1 has 5915877 observations and 5 variables.
NOTE: DATA statement used (Total process time):
      real time           1.29 seconds
      cpu time            0.51 seconds
      

986   /* get expense ratio data required to get gross returns */
987   proc sql;
988         create table returns2 as select a.*, b.exp_ratio
989         from returns1 (rename=(tna=mtna)) as a left join data.fund_fees as b
990         on a.crsp_fundno=b.crsp_fundno and date between b.begdt and b.enddt
991         order by crsp_fundno, date;
NOTE: Table WORK.RETURNS2 created, with 5917964 rows and 6 columns.

992   quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           4.29 seconds
      cpu time            5.42 seconds
      

993   /* compute gross returns */
994   data returns2; set returns2;
995         by crsp_fundno date;
996         if exp_ratio = -99 then exp_ratio=.;
997         weight = lag(mtna);
998         if first.crsp_fundno then weight = mtna;
999         rret=sum(mret,exp_ratio/12);
1000        format rret comma8.4;
1001        *drop exp_ratio;
1002  run;

NOTE: Missing values were generated as a result of performing an operation on missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      149556 at 999:12    1163202 at 999:30   
NOTE: There were 5917964 observations read from the data set WORK.RETURNS2.
NOTE: The data set WORK.RETURNS2 has 5917964 observations and 8 variables.
NOTE: DATA statement used (Total process time):
      real time           1.76 seconds
      cpu time            0.68 seconds
      

1003  /* aggregate multiple share classes */
1004  proc sort data = returns2; by wficn date; run;

NOTE: There were 5917964 observations read from the data set WORK.RETURNS2.
NOTE: The data set WORK.RETURNS2 has 5917964 observations and 8 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.81 seconds
      cpu time            1.96 seconds
      

1005  
1006  data multiclass1 oneclass; set returns2;
1007        by wficn date;
1008        if first.date=0 or last.date=0 then output multiclass1;
1009        else output oneclass;
1010  run;

NOTE: There were 5917964 observations read from the data set WORK.RETURNS2.
NOTE: The data set WORK.MULTICLASS1 has 5067912 observations and 8 variables.
NOTE: The data set WORK.ONECLASS has 850052 observations and 8 variables.
NOTE: DATA statement used (Total process time):
      real time           0.59 seconds
      cpu time            0.59 seconds
      

1011  /* aggregate returns to the wficn-month level */
1012  proc sql;
1013        create table multiclass2
1014        as select wficn, date, sum(mret*weight)/sum(weight) as mret,
1015        sum(mtna) as mtna, sum(rret*weight)/sum(weight) as rret
1016        from multiclass1 group by wficn, date;
NOTE: Table WORK.MULTICLASS2 created, with 1272164 rows and 5 columns.

1017  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           1.22 seconds
      cpu time            1.92 seconds
      

1018  /* create some local date vars for merging */
1019  %let md = (year(date)*12 + month(date) - 1925*12 - 11);
1020  %let qd = (year(date)*4  + qtr(date)   - 1925*4);
1021  
1022  data returns; set oneclass (drop=weight) multiclass2;
1023        md = &md;
1024        qd = &qd;
1025        rename mret=ret mtna=tna;
1026        *drop crsp_fundno ;
1027  run;

NOTE: Missing values were generated as a result of performing an operation on missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      391 at 1:3    391 at 1:13   391 at 1:3    391 at 1:13   
NOTE: There were 850052 observations read from the data set WORK.ONECLASS.
NOTE: There were 1272164 observations read from the data set WORK.MULTICLASS2.
NOTE: The data set WORK.RETURNS has 2122216 observations and 9 variables.
NOTE: DATA statement used (Total process time):
      real time           0.46 seconds
      cpu time            0.43 seconds
      

1028  proc sort data = returns nodupkey; by wficn md; run;

NOTE: There were 2122216 observations read from the data set WORK.RETURNS.
NOTE: 0 observations with duplicate key values were deleted.
NOTE: The data set WORK.RETURNS has 2122216 observations and 9 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.36 seconds
      cpu time            0.59 seconds
      

1029  * house cleaning;
1030  proc datasets nowarn nolist nodetails;
NOTE: Writing HTML Body file: sashtml.htm
1031        delete multiclass1 multiclass2 oneclass returns1 returns2;
1032  quit;

NOTE: Deleting WORK.MULTICLASS1 (memtype=DATA).
NOTE: Deleting WORK.MULTICLASS2 (memtype=DATA).
NOTE: Deleting WORK.ONECLASS (memtype=DATA).
NOTE: Deleting WORK.RETURNS1 (memtype=DATA).
NOTE: Deleting WORK.RETURNS2 (memtype=DATA).
NOTE: PROCEDURE DATASETS used (Total process time):
      real time           0.64 seconds
      cpu time            0.37 seconds
      

1033  
1034  data returns;
1035      set returns;
1036      logtna = log(tna);
1037  run;

NOTE: Invalid argument to function LOG(0) at line 1036 column 14.
wficn=100302 crsp_fundno=008035 date=20080430 ret=0.008234 tna=0 exp_ratio=0.013000 rret=0.0093
md=989 qd=334 logtna=. _ERROR_=1 _N_=40547
NOTE: Invalid argument to function LOG(0) at line 1036 column 14.
wficn=100302 crsp_fundno=008035 date=20080530 ret=0.026726 tna=0 exp_ratio=0.013000 rret=0.0278
md=990 qd=334 logtna=. _ERROR_=1 _N_=40548
NOTE: Invalid argument to function LOG(0) at line 1036 column 14.
wficn=100503 crsp_fundno=006788 date=20080530 ret=0.038117 tna=0 exp_ratio=0.020000 rret=0.0398
md=990 qd=334 logtna=. _ERROR_=1 _N_=68058
NOTE: Invalid argument to function LOG(0) at line 1036 column 14.
wficn=100552 crsp_fundno=013612 date=20080630 ret=. tna=0 exp_ratio=. rret=. md=991 qd=334
logtna=. _ERROR_=1 _N_=73196
NOTE: Invalid argument to function LOG(0) at line 1036 column 14.
wficn=100552 crsp_fundno=013612 date=20080731 ret=. tna=0 exp_ratio=. rret=. md=992 qd=335
logtna=. _ERROR_=1 _N_=73197
NOTE: Invalid argument to function LOG(0) at line 1036 column 14.
wficn=100685 crsp_fundno=008036 date=20080430 ret=0.054511 tna=0 exp_ratio=0.015000 rret=0.0558
md=989 qd=334 logtna=. _ERROR_=1 _N_=88451
NOTE: Invalid argument to function LOG(0) at line 1036 column 14.
wficn=100685 crsp_fundno=008036 date=20080530 ret=0.044563 tna=0 exp_ratio=0.015000 rret=0.0458
md=990 qd=334 logtna=. _ERROR_=1 _N_=88452
NOTE: Invalid argument to function LOG(0) at line 1036 column 14.
wficn=100789 crsp_fundno=009208 date=20080430 ret=0.011013 tna=0 exp_ratio=0.022700 rret=0.0129
md=989 qd=334 logtna=. _ERROR_=1 _N_=103441
NOTE: Invalid argument to function LOG(0) at line 1036 column 14.
wficn=100789 crsp_fundno=009208 date=20080530 ret=0.052288 tna=0 exp_ratio=0.022700 rret=0.0542
md=990 qd=334 logtna=. _ERROR_=1 _N_=103442
NOTE: Invalid argument to function LOG(0) at line 1036 column 14.
wficn=100789 crsp_fundno=009208 date=20080630 ret=0.047619 tna=0 exp_ratio=0.022700 rret=0.0495
md=991 qd=334 logtna=. _ERROR_=1 _N_=103443
NOTE: Invalid argument to function LOG(0) at line 1036 column 14.
wficn=100789 crsp_fundno=009208 date=20080731 ret=-0.033597 tna=0 exp_ratio=0.021700 rret=-0.0318
md=992 qd=335 logtna=. _ERROR_=1 _N_=103444
NOTE: Invalid argument to function LOG(0) at line 1036 column 14.
wficn=100789 crsp_fundno=009208 date=20080829 ret=-0.036810 tna=0 exp_ratio=0.021700 rret=-0.0350
md=993 qd=335 logtna=. _ERROR_=1 _N_=103445
NOTE: Invalid argument to function LOG(0) at line 1036 column 14.
wficn=100789 crsp_fundno=009208 date=20080930 ret=-0.097665 tna=0 exp_ratio=0.021700 rret=-0.0959
md=994 qd=335 logtna=. _ERROR_=1 _N_=103446
NOTE: Invalid argument to function LOG(0) at line 1036 column 14.
wficn=100789 crsp_fundno=009208 date=20081031 ret=0.002353 tna=0 exp_ratio=0.021700 rret=0.0042
md=995 qd=336 logtna=. _ERROR_=1 _N_=103447
NOTE: Invalid argument to function LOG(0) at line 1036 column 14.
wficn=100789 crsp_fundno=009208 date=20081128 ret=0.002347 tna=0 exp_ratio=0.021700 rret=0.0042
md=996 qd=336 logtna=. _ERROR_=1 _N_=103448
NOTE: Invalid argument to function LOG(0) at line 1036 column 14.
wficn=100789 crsp_fundno=009208 date=20081231 ret=0.000000 tna=0 exp_ratio=0.021700 rret=0.0018
md=997 qd=336 logtna=. _ERROR_=1 _N_=103449
NOTE: Invalid argument to function LOG(0) at line 1036 column 14.
wficn=100789 crsp_fundno=009208 date=20090130 ret=-0.002342 tna=0 exp_ratio=0.021700 rret=-0.0005
md=998 qd=337 logtna=. _ERROR_=1 _N_=103450
NOTE: Invalid argument to function LOG(0) at line 1036 column 14.
wficn=100789 crsp_fundno=009208 date=20090227 ret=-0.002347 tna=0 exp_ratio=0.021700 rret=-0.0005
md=999 qd=337 logtna=. _ERROR_=1 _N_=103451
NOTE: Invalid argument to function LOG(0) at line 1036 column 14.
wficn=100789 crsp_fundno=009208 date=20090331 ret=0.000000 tna=0 exp_ratio=0.021700 rret=0.0018
md=1000 qd=337 logtna=. _ERROR_=1 _N_=103452
NOTE: Invalid argument to function LOG(0) at line 1036 column 14.
WARNING: Limit set by ERRORS= option reached.  Further errors of this type will not be printed.
wficn=100789 crsp_fundno=009208 date=20090430 ret=0.000000 tna=0 exp_ratio=0.021700 rret=0.0018
md=1001 qd=338 logtna=. _ERROR_=1 _N_=103453
NOTE: Missing values were generated as a result of performing an operation on missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      15308 at 1036:14   
NOTE: Mathematical operations could not be performed at the following places. The results of the 
      operations have been set to missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      265 at 1036:14   
NOTE: There were 2122216 observations read from the data set WORK.RETURNS.
NOTE: The data set WORK.RETURNS has 2122216 observations and 10 variables.
NOTE: DATA statement used (Total process time):
      real time           0.15 seconds
      cpu time            0.15 seconds
      

1038  
1039  *Obtain fund characteristics ;
1040  %let md = (year(caldt)*12 + month(caldt) - 1925*12 - 11);
1041  %let qd = (year(caldt)*4  + qtr(caldt)   - 1925*4);
1042  data fundchars; merge MF_Port (in=in1) data.fund_summary2;
1043      by crsp_fundno;
1044      md = &md;
1045      qd = &qd;
1046      fundage = log(year(caldt) - year(first_offer_dt));
1047      per_cash2 = sum(per_cash, per_muni, per_govt )/100;
1048      per_cash = per_cash/100;
1049      if wficn ne .;
1050      rename caldt=date;
1051      keep crsp_fundno wficn caldt date mgmt_fee turn_ratio first_offer_dt
1052      mgmt_name mgmt_cd fundage md qd per_cash per_muni per_govt per_cash2 nav_latest ;
1053  run;

WARNING: The variable date in the DROP, KEEP, or RENAME list has never been referenced.
NOTE: Invalid argument to function LOG(0) at line 1046 column 15.
in1=0 wficn=. crsp_fundno=000001 summary_period2=A caldt=19971231 summary_period=A
nav_latest=15.3000000 nav_latest_dt=19971231 tna_latest=81.000 tna_latest_dt=19971231
yield=0.0620065359 div_ytd=0.94870000000 cap_gains_ytd=0.02000000000 nav_52w_h=. nav_52w_h_dt=.
nav_52w_l=. nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19980630 per_com=0
per_pref=0 per_conv=0 per_corp=88.13 per_muni=0 per_govt=3.34 per_oth=0.02 per_cash=0.0851
per_bond=0 per_abs=. per_mbs=. per_eq_oth=. per_fi_oth=. maturity=9.8 maturity_dt=19980630
cusip8=  crsp_portno=. crsp_cl_grp=. fund_name=AARP Income Tr:Bond for Income ticker=AABIX
ncusip=  mgmt_name=SCUDDER STEVENS & CLARK mgmt_cd=  mgr_name=Stephen A Wohler mgr_dt=19970201
adv_name=  open_to_inv=  retail_fund=  inst_fund=  m_fund=N index_fund_flag=  vau_fund=N
et_flag=  delist_cd=  header=0 first_offer_dt=19970201 end_dt=20000731 dead_flag=Y
merge_fundno=008441 actual_12b1=0.000000 max_12b1=. mgmt_fee=-0.282000 exp_ratio=0.001900
turn_ratio=1.310000 fiscal_yearend=19980930 crsp_obj_cd=ICQM si_obj_cd=CMQ accrual_fund= 
sales_restrict=  wbrger_obj_cd=  policy=  lipper_class=  lipper_class_name=  lipper_obj_cd= 
lipper_obj_name=  lipper_asset_cd=  lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=865
qd=292 fundage=. per_cash2=0.1185 _ERROR_=1 _N_=1
NOTE: Invalid argument to function LOG(0) at line 1046 column 15.
in1=1 wficn=301534 crsp_fundno=000002 summary_period2=A caldt=19971231 summary_period=A
nav_latest=17.0900000 nav_latest_dt=19971231 tna_latest=72.000 tna_latest_dt=19971231
yield=0.0187244002 div_ytd=0.32000000000 cap_gains_ytd=0.10000000000 nav_52w_h=. nav_52w_h_dt=.
nav_52w_l=. nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19980630 per_com=0
per_pref=0 per_conv=0 per_corp=0 per_muni=0 per_govt=0 per_oth=98.55 per_cash=0.0145 per_bond=0
per_abs=. per_mbs=. per_eq_oth=. per_fi_oth=. maturity=. maturity_dt=. cusip8=  crsp_portno=.
crsp_cl_grp=. fund_name=AARP Mngd Inv Port Tr:Diversified Growth ticker=AADGX ncusip= 
mgmt_name=SCUDDER STEVENS & CLARK mgmt_cd=  mgr_name=Philip S Fortuna mgr_dt=19970201 adv_name= 
open_to_inv=  retail_fund=  inst_fund=  m_fund=N index_fund_flag=  vau_fund=N et_flag= 
delist_cd=  header=0 first_offer_dt=19970203 end_dt=20000831 dead_flag=Y merge_fundno=008425
actual_12b1=0.000000 max_12b1=. mgmt_fee=0.000000 exp_ratio=0.000000 turn_ratio=0.060000
fiscal_yearend=19980930 crsp_obj_cd=EDYG si_obj_cd=GRO accrual_fund=  sales_restrict= 
wbrger_obj_cd=  policy=  lipper_class=  lipper_class_name=  lipper_obj_cd=  lipper_obj_name= 
lipper_asset_cd=  lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=865 qd=292 fundage=.
per_cash2=0.0145 _ERROR_=1 _N_=10
NOTE: Invalid argument to function LOG(0) at line 1046 column 15.
in1=0 wficn=. crsp_fundno=000003 summary_period2=A caldt=19931231 summary_period=A
nav_latest=10.4200000 nav_latest_dt=19931231 tna_latest=0.013 tna_latest_dt=19931231
yield=0.0574856046 div_ytd=0.59900000000 cap_gains_ytd=0.40580000000 nav_52w_h=. nav_52w_h_dt=.
nav_52w_l=. nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19931231 per_com=0
per_pref=0 per_conv=0 per_corp=0 per_muni=0 per_govt=0 per_oth=0 per_cash=0 per_bond=0 per_abs=.
per_mbs=. per_eq_oth=. per_fi_oth=. maturity=. maturity_dt=. cusip8=  crsp_portno=. crsp_cl_grp=.
fund_name=Rembrandt Funds:Global Fixed Income Fund/Inv ticker=  ncusip= 
mgmt_name=LaSalle Street Capital Mgmt Ltd mgmt_cd=  mgr_name=Roy Scheepe mgr_dt=19930201
adv_name=  open_to_inv=  retail_fund=  inst_fund=  m_fund=N index_fund_flag=  vau_fund=N
et_flag=  delist_cd=  header=0 first_offer_dt=19930426 end_dt=20000831 dead_flag=Y merge_fundno=.
actual_12b1=0.002500 max_12b1=. mgmt_fee=. exp_ratio=0.015600 turn_ratio=1.460000
fiscal_yearend=. crsp_obj_cd=IF si_obj_cd=BGN accrual_fund=  sales_restrict=  wbrger_obj_cd= 
policy=  lipper_class=  lipper_class_name=  lipper_obj_cd=  lipper_obj_name=  lipper_asset_cd= 
lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=817 qd=276 fundage=. per_cash2=0
_ERROR_=1 _N_=19
NOTE: Invalid argument to function LOG(0) at line 1046 column 15.
in1=1 wficn=401172 crsp_fundno=000004 summary_period2=A caldt=19971231 summary_period=A
nav_latest=16.4600000 nav_latest_dt=19971231 tna_latest=23.800 tna_latest_dt=19971231
yield=0.0066828676 div_ytd=0.11000000000 cap_gains_ytd=0.15000000000 nav_52w_h=. nav_52w_h_dt=.
nav_52w_l=. nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19980630
per_com=91.3 per_pref=1.1 per_conv=1.4 per_corp=0 per_muni=0 per_govt=0 per_oth=0.3
per_cash=0.059 per_bond=0 per_abs=. per_mbs=. per_eq_oth=. per_fi_oth=. maturity=0.0
maturity_dt=19980630 cusip8=  crsp_portno=. crsp_cl_grp=.
fund_name=AARP Growth Tr:International Growth & Income ticker=AAISX ncusip= 
mgmt_name=SCUDDER STEVENS & CLARK mgmt_cd=  mgr_name=Sheridan Reilly mgr_dt=19970201 adv_name= 
open_to_inv=  retail_fund=  inst_fund=  m_fund=N index_fund_flag=  vau_fund=N et_flag= 
delist_cd=  header=0 first_offer_dt=19970203 end_dt=20000731 dead_flag=Y merge_fundno=008513
actual_12b1=0.000000 max_12b1=. mgmt_fee=0.222000 exp_ratio=0.017500 turn_ratio=0.750000
fiscal_yearend=19980930 crsp_obj_cd=EFYT si_obj_cd=EIT accrual_fund=  sales_restrict= 
wbrger_obj_cd=  policy=  lipper_class=  lipper_class_name=  lipper_obj_cd=  lipper_obj_name= 
lipper_asset_cd=  lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=865 qd=292 fundage=.
per_cash2=0.059 _ERROR_=1 _N_=32
NOTE: Invalid argument to function LOG(0) at line 1046 column 15.
in1=0 wficn=. crsp_fundno=000008 summary_period2=A caldt=19901231 summary_period=A
nav_latest=13.2700000 nav_latest_dt=19901231 tna_latest=0.160 tna_latest_dt=19901231
yield=0.0021929164 div_ytd=0.02910000000 cap_gains_ytd=0.00000000000 nav_52w_h=. nav_52w_h_dt=.
nav_52w_l=. nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19901231 per_com=0
per_pref=0 per_conv=0 per_corp=0 per_muni=0 per_govt=0 per_oth=0 per_cash=0 per_bond=0 per_abs=.
per_mbs=. per_eq_oth=. per_fi_oth=. maturity=. maturity_dt=. cusip8=  crsp_portno=. crsp_cl_grp=.
fund_name=EQUITABLE BALANCED FUND/A ticker=  ncusip=  mgmt_name=  mgmt_cd=  mgr_name= 
mgr_dt=19900901 adv_name=  open_to_inv=  retail_fund=  inst_fund=  m_fund=N index_fund_flag= 
vau_fund=N et_flag=  delist_cd=  header=0 first_offer_dt=19900101 end_dt=19990129 dead_flag=Y
merge_fundno=004089 actual_12b1=. max_12b1=. mgmt_fee=. exp_ratio=0.000000 turn_ratio=.
fiscal_yearend=. crsp_obj_cd=  si_obj_cd=  accrual_fund=  sales_restrict=  wbrger_obj_cd= 
policy=  lipper_class=  lipper_class_name=  lipper_obj_cd=  lipper_obj_name=  lipper_asset_cd= 
lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=781 qd=264 fundage=. per_cash2=0
_ERROR_=1 _N_=54
NOTE: Invalid argument to function LOG(0) at line 1046 column 15.
in1=0 wficn=. crsp_fundno=000009 summary_period2=A caldt=19871231 summary_period=A
nav_latest=10.7000000 nav_latest_dt=19871231 tna_latest=1.980 tna_latest_dt=19871231
yield=0.0002336449 div_ytd=0.00250000000 cap_gains_ytd=0.05510000000 nav_52w_h=. nav_52w_h_dt=.
nav_52w_l=. nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19871231 per_com=0
per_pref=0 per_conv=0 per_corp=0 per_muni=0 per_govt=0 per_oth=0 per_cash=0 per_bond=0 per_abs=.
per_mbs=. per_eq_oth=. per_fi_oth=. maturity=. maturity_dt=. cusip8=  crsp_portno=. crsp_cl_grp=.
fund_name=Equitable Balanced B ticker=  ncusip=  mgmt_name=  mgmt_cd=  mgr_name=  mgr_dt=19871001
adv_name=  open_to_inv=  retail_fund=  inst_fund=  m_fund=N index_fund_flag=  vau_fund=N
et_flag=  delist_cd=  header=0 first_offer_dt=19870101 end_dt=19990129 dead_flag=Y
merge_fundno=004090 actual_12b1=. max_12b1=. mgmt_fee=. exp_ratio=0.000000 turn_ratio=.
fiscal_yearend=. crsp_obj_cd=  si_obj_cd=  accrual_fund=  sales_restrict=  wbrger_obj_cd= 
policy=  lipper_class=  lipper_class_name=  lipper_obj_cd=  lipper_obj_name=  lipper_asset_cd= 
lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=745 qd=252 fundage=. per_cash2=0
_ERROR_=1 _N_=64
NOTE: Invalid argument to function LOG(0) at line 1046 column 15.
in1=0 wficn=. crsp_fundno=000010 summary_period2=A caldt=19931231 summary_period=A
nav_latest=15.2500000 nav_latest_dt=19931231 tna_latest=0.971 tna_latest_dt=19931231
yield=0.008852459 div_ytd=0.13500000000 cap_gains_ytd=1.17000000000 nav_52w_h=. nav_52w_h_dt=.
nav_52w_l=. nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19940630
per_com=54.5 per_pref=0 per_conv=2.7 per_corp=4.7 per_muni=0 per_govt=13.1 per_oth=0
per_cash=0.25 per_bond=0 per_abs=. per_mbs=. per_eq_oth=. per_fi_oth=. maturity=0.0
maturity_dt=19940630 cusip8=  crsp_portno=. crsp_cl_grp=.
fund_name=Alliance Port:Strategic Balanced Fund/C ticker=  ncusip= 
mgmt_name=ALLIANCE CAPITAL MANAGEMENT CORP. mgmt_cd=  mgr_name=Judith Taylor mgr_dt=19930801
adv_name=  open_to_inv=  retail_fund=  inst_fund=  m_fund=N index_fund_flag=  vau_fund=N
et_flag=  delist_cd=  header=0 first_offer_dt=19930101 end_dt=19990129 dead_flag=Y
merge_fundno=004091 actual_12b1=0.010000 max_12b1=. mgmt_fee=. exp_ratio=0.021000 turn_ratio=.
fiscal_yearend=. crsp_obj_cd=M si_obj_cd=BAL accrual_fund=  sales_restrict=  wbrger_obj_cd= 
policy=  lipper_class=  lipper_class_name=  lipper_obj_cd=  lipper_obj_name=  lipper_asset_cd= 
lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=817 qd=276 fundage=. per_cash2=0.381
_ERROR_=1 _N_=77
NOTE: Invalid argument to function LOG(0) at line 1046 column 15.
in1=1 wficn=100005 crsp_fundno=000012 summary_period2=A caldt=19941230 summary_period=A
nav_latest=14.3200000 nav_latest_dt=19941230 tna_latest=177.932 tna_latest_dt=19941230
yield=0.0275837989 div_ytd=0.39500000000 cap_gains_ytd=0.03900000000 nav_52w_h=. nav_52w_h_dt=.
nav_52w_l=. nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19950929 per_com=52
per_pref=0 per_conv=4 per_corp=4 per_muni=0 per_govt=19 per_oth=3 per_cash=0.18 per_bond=0
per_abs=. per_mbs=. per_eq_oth=. per_fi_oth=. maturity=0.0 maturity_dt=19950929 cusip8= 
crsp_portno=. crsp_cl_grp=. fund_name=AARP Growth Tr:Balanced Stock and Bond Fund ticker=ABSBX
ncusip=  mgmt_name=SCUDDER STEVENS & CLARK mgmt_cd=  mgr_name=Robert T Hoffman mgr_dt=19940201
adv_name=  open_to_inv=  retail_fund=  inst_fund=  m_fund=N index_fund_flag=  vau_fund=N
et_flag=  delist_cd=  header=0 first_offer_dt=19940201 end_dt=20000731 dead_flag=Y
merge_fundno=028248 actual_12b1=0.000000 max_12b1=. mgmt_fee=. exp_ratio=0.010100
turn_ratio=0.637700 fiscal_yearend=. crsp_obj_cd=M si_obj_cd=BAL accrual_fund=  sales_restrict= 
wbrger_obj_cd=  policy=  lipper_class=  lipper_class_name=  lipper_obj_cd=  lipper_obj_name= 
lipper_asset_cd=  lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=829 qd=280 fundage=.
per_cash2=0.37 _ERROR_=1 _N_=90
NOTE: Invalid argument to function LOG(0) at line 1046 column 15.
in1=0 wficn=. crsp_fundno=000015 summary_period2=A caldt=19911231 summary_period=A
nav_latest=10.1700000 nav_latest_dt=19911231 tna_latest=5.750 tna_latest_dt=19911231 yield=.
div_ytd=0.00000000000 cap_gains_ytd=0.06000000000 nav_52w_h=. nav_52w_h_dt=. nav_52w_l=.
nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19911231 per_com=0 per_pref=0
per_conv=0 per_corp=0 per_muni=0 per_govt=0 per_oth=0 per_cash=0 per_bond=0 per_abs=. per_mbs=.
per_eq_oth=. per_fi_oth=. maturity=. maturity_dt=. cusip8=  crsp_portno=. crsp_cl_grp=.
fund_name=AMERICAN CAPITAL GLOBAL EQUITY FUND/A ticker=  ncusip=  mgmt_name=  mgmt_cd= 
mgr_name=  mgr_dt=19910801 adv_name=  open_to_inv=  retail_fund=  inst_fund=  m_fund=N
index_fund_flag=  vau_fund=N et_flag=  delist_cd=  header=0 first_offer_dt=19910101
end_dt=19980529 dead_flag=Y merge_fundno=031048 actual_12b1=. max_12b1=. mgmt_fee=.
exp_ratio=0.000000 turn_ratio=. fiscal_yearend=. crsp_obj_cd=  si_obj_cd=  accrual_fund= 
sales_restrict=  wbrger_obj_cd=  policy=  lipper_class=  lipper_class_name=  lipper_obj_cd= 
lipper_obj_name=  lipper_asset_cd=  lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=793
qd=268 fundage=. per_cash2=0 _ERROR_=1 _N_=121
NOTE: Invalid argument to function LOG(0) at line 1046 column 15.
in1=1 wficn=401008 crsp_fundno=000016 summary_period2=A caldt=19911231 summary_period=A
nav_latest=10.2300000 nav_latest_dt=19911231 tna_latest=0.558 tna_latest_dt=19911231 yield=.
div_ytd=0.00000000000 cap_gains_ytd=0.06000000000 nav_52w_h=. nav_52w_h_dt=. nav_52w_l=.
nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19911231 per_com=0 per_pref=0
per_conv=0 per_corp=0 per_muni=0 per_govt=0 per_oth=0 per_cash=0 per_bond=0 per_abs=. per_mbs=.
per_eq_oth=. per_fi_oth=. maturity=. maturity_dt=. cusip8=  crsp_portno=. crsp_cl_grp=.
fund_name=AMERICAN CAPITAL GLOBAL EQUITY FUND/B ticker=  ncusip=  mgmt_name=  mgmt_cd= 
mgr_name=  mgr_dt=19911101 adv_name=  open_to_inv=  retail_fund=  inst_fund=  m_fund=N
index_fund_flag=  vau_fund=N et_flag=  delist_cd=  header=0 first_offer_dt=19910101
end_dt=19980529 dead_flag=Y merge_fundno=031046 actual_12b1=. max_12b1=. mgmt_fee=.
exp_ratio=0.000000 turn_ratio=. fiscal_yearend=. crsp_obj_cd=  si_obj_cd=  accrual_fund= 
sales_restrict=  wbrger_obj_cd=  policy=  lipper_class=  lipper_class_name=  lipper_obj_cd= 
lipper_obj_name=  lipper_asset_cd=  lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=793
qd=268 fundage=. per_cash2=0 _ERROR_=1 _N_=129
NOTE: Invalid argument to function LOG(0) at line 1046 column 15.
in1=1 wficn=401008 crsp_fundno=000017 summary_period2=A caldt=19931231 summary_period=A
nav_latest=11.5500000 nav_latest_dt=19931231 tna_latest=2.570 tna_latest_dt=19931231 yield=.
div_ytd=0.00000000000 cap_gains_ytd=0.04250000000 nav_52w_h=. nav_52w_h_dt=. nav_52w_l=.
nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19940630 per_com=93 per_pref=0
per_conv=0 per_corp=0 per_muni=0 per_govt=0 per_oth=0 per_cash=0.07 per_bond=0 per_abs=.
per_mbs=. per_eq_oth=. per_fi_oth=. maturity=0.0 maturity_dt=19940630 cusip8=  crsp_portno=.
crsp_cl_grp=. fund_name=American Capital World:Global Equity Fund/C ticker=ACGCX ncusip= 
mgmt_name=AMERICAN CAPITAL ASSET MANAGEMENT mgmt_cd=  mgr_name=Jeff New mgr_dt=19940401
adv_name=  open_to_inv=  retail_fund=  inst_fund=  m_fund=N index_fund_flag=  vau_fund=N
et_flag=  delist_cd=  header=0 first_offer_dt=19930101 end_dt=19980529 dead_flag=Y
merge_fundno=031045 actual_12b1=0.010000 max_12b1=. mgmt_fee=. exp_ratio=0.032100
turn_ratio=1.160000 fiscal_yearend=. crsp_obj_cd=EFYG si_obj_cd=EGG accrual_fund= 
sales_restrict=  wbrger_obj_cd=  policy=  lipper_class=  lipper_class_name=  lipper_obj_cd= 
lipper_obj_name=  lipper_asset_cd=  lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=817
qd=276 fundage=. per_cash2=0.07 _ERROR_=1 _N_=137
NOTE: Invalid argument to function LOG(0) at line 1046 column 15.
in1=0 wficn=. crsp_fundno=000018 summary_period2=A caldt=19761231 summary_period=A
nav_latest=24.5800000 nav_latest_dt=19761231 tna_latest=11.100 tna_latest_dt=19761231 yield=.
div_ytd=0.00000000000 cap_gains_ytd=0.00000000000 nav_52w_h=. nav_52w_h_dt=. nav_52w_l=.
nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19761231 per_com=0 per_pref=0
per_conv=0 per_corp=0 per_muni=0 per_govt=0 per_oth=0 per_cash=0 per_bond=0 per_abs=. per_mbs=.
per_eq_oth=. per_fi_oth=. maturity=. maturity_dt=. cusip8=  crsp_portno=. crsp_cl_grp=.
fund_name=American General Muni Bond Fund ticker=ACMBX ncusip=  mgmt_name=  mgmt_cd=  mgr_name= 
mgr_dt=19880101 adv_name=  open_to_inv=  retail_fund=  inst_fund=  m_fund=N index_fund_flag= 
vau_fund=N et_flag=  delist_cd=  header=0 first_offer_dt=19760101 end_dt=19950831 dead_flag=Y
merge_fundno=030948 actual_12b1=. max_12b1=. mgmt_fee=. exp_ratio=0.000000 turn_ratio=.
fiscal_yearend=. crsp_obj_cd=  si_obj_cd=  accrual_fund=  sales_restrict=  wbrger_obj_cd= 
policy=Bonds lipper_class=  lipper_class_name=  lipper_obj_cd=  lipper_obj_name= 
lipper_asset_cd=  lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=613 qd=208 fundage=.
per_cash2=0 _ERROR_=1 _N_=143
NOTE: Invalid argument to function LOG(0) at line 1046 column 15.
in1=0 wficn=. crsp_fundno=000019 summary_period2=A caldt=19921231 summary_period=A
nav_latest=10.0200000 nav_latest_dt=19921231 tna_latest=3.773 tna_latest_dt=19921231
yield=0.0185628743 div_ytd=0.18600000000 cap_gains_ytd=0.00000000000 nav_52w_h=. nav_52w_h_dt=.
nav_52w_l=. nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19930331 per_com=0
per_pref=0 per_conv=0 per_corp=0 per_muni=95 per_govt=0 per_oth=0 per_cash=0.05 per_bond=0
per_abs=. per_mbs=. per_eq_oth=. per_fi_oth=. maturity=21.3 maturity_dt=19930331 cusip8= 
crsp_portno=. crsp_cl_grp=. fund_name=AMERICAN CAPITAL MUNICIPAL BOND FUND/B ticker=  ncusip= 
mgmt_name=AMERICAN CAPITAL ASSET MANAGEMENT mgmt_cd=  mgr_name=ROBERT EVANS mgr_dt=19920901
adv_name=  open_to_inv=  retail_fund=  inst_fund=  m_fund=N index_fund_flag=  vau_fund=N
et_flag=  delist_cd=  header=0 first_offer_dt=19920101 end_dt=19950831 dead_flag=Y
merge_fundno=030949 actual_12b1=0.010000 max_12b1=. mgmt_fee=. exp_ratio=0.017100 turn_ratio=.
fiscal_yearend=. crsp_obj_cd=IU si_obj_cd=MGN accrual_fund=  sales_restrict=  wbrger_obj_cd= 
policy=  lipper_class=  lipper_class_name=  lipper_obj_cd=  lipper_obj_name=  lipper_asset_cd= 
lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=805 qd=272 fundage=. per_cash2=1
_ERROR_=1 _N_=163
NOTE: Invalid argument to function LOG(0) at line 1046 column 15.
in1=0 wficn=. crsp_fundno=000020 summary_period2=A caldt=19931231 summary_period=A
nav_latest=10.5200000 nav_latest_dt=19931231 tna_latest=4.137 tna_latest_dt=19931231
yield=0.0199619772 div_ytd=0.21000000000 cap_gains_ytd=0.00000000000 nav_52w_h=. nav_52w_h_dt=.
nav_52w_l=. nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19931231 per_com=0
per_pref=0 per_conv=0 per_corp=0 per_muni=0 per_govt=0 per_oth=0 per_cash=0 per_bond=0 per_abs=.
per_mbs=. per_eq_oth=. per_fi_oth=. maturity=. maturity_dt=. cusip8=  crsp_portno=. crsp_cl_grp=.
fund_name=American Capital Municipal Bond Fund/C ticker=  ncusip=  mgmt_name=  mgmt_cd= 
mgr_name=  mgr_dt=19950401 adv_name=  open_to_inv=  retail_fund=  inst_fund=  m_fund=N
index_fund_flag=  vau_fund=N et_flag=  delist_cd=  header=0 first_offer_dt=19930101
end_dt=19950831 dead_flag=Y merge_fundno=030950 actual_12b1=. max_12b1=. mgmt_fee=.
exp_ratio=0.000000 turn_ratio=. fiscal_yearend=. crsp_obj_cd=  si_obj_cd=  accrual_fund= 
sales_restrict=  wbrger_obj_cd=  policy=  lipper_class=  lipper_class_name=  lipper_obj_cd= 
lipper_obj_name=  lipper_asset_cd=  lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=817
qd=276 fundage=. per_cash2=0 _ERROR_=1 _N_=167
NOTE: Invalid argument to function LOG(0) at line 1046 column 15.
in1=0 wficn=. crsp_fundno=000021 summary_period2=A caldt=19901231 summary_period=A
nav_latest=9.9800000 nav_latest_dt=19901231 tna_latest=15.582 tna_latest_dt=19901231
yield=0.0095190381 div_ytd=0.09500000000 cap_gains_ytd=0.00000000000 nav_52w_h=. nav_52w_h_dt=.
nav_52w_l=. nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19901231 per_com=0
per_pref=0 per_conv=0 per_corp=0 per_muni=0 per_govt=0 per_oth=0 per_cash=0 per_bond=0 per_abs=.
per_mbs=. per_eq_oth=. per_fi_oth=. maturity=. maturity_dt=. cusip8=  crsp_portno=. crsp_cl_grp=.
fund_name=AMERICAN CAPITAL GOVERNMENT TGT SRS-PORT '97 ticker=  ncusip=  mgmt_name=  mgmt_cd= 
mgr_name=  mgr_dt=19900901 adv_name=  open_to_inv=  retail_fund=  inst_fund=  m_fund=N
index_fund_flag=  vau_fund=N et_flag=  delist_cd=  header=0 first_offer_dt=19900101
end_dt=19971128 dead_flag=Y merge_fundno=. actual_12b1=. max_12b1=. mgmt_fee=. exp_ratio=0.000000
turn_ratio=. fiscal_yearend=. crsp_obj_cd=  si_obj_cd=  accrual_fund=  sales_restrict= 
wbrger_obj_cd=  policy=  lipper_class=  lipper_class_name=  lipper_obj_cd=  lipper_obj_name= 
lipper_asset_cd=  lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=781 qd=264 fundage=.
per_cash2=0 _ERROR_=1 _N_=170
NOTE: Invalid argument to function LOG(0) at line 1046 column 15.
in1=0 wficn=. crsp_fundno=000022 summary_period2=A caldt=19911231 summary_period=A
nav_latest=10.7600000 nav_latest_dt=19911231 tna_latest=8.795 tna_latest_dt=19911231
yield=0.0269516729 div_ytd=0.29000000000 cap_gains_ytd=0.04250000000 nav_52w_h=. nav_52w_h_dt=.
nav_52w_l=. nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19911231 per_com=0
per_pref=0 per_conv=0 per_corp=0 per_muni=0 per_govt=0 per_oth=0 per_cash=0 per_bond=0 per_abs=.
per_mbs=. per_eq_oth=. per_fi_oth=. maturity=. maturity_dt=. cusip8=  crsp_portno=. crsp_cl_grp=.
fund_name=AMERICAN CAPITAL GOVERNMENT TGT SRS-PORT '98 ticker=  ncusip=  mgmt_name=  mgmt_cd= 
mgr_name=  mgr_dt=19910101 adv_name=  open_to_inv=  retail_fund=  inst_fund=  m_fund=N
index_fund_flag=  vau_fund=N et_flag=  delist_cd=  header=0 first_offer_dt=19910101
end_dt=19930331 dead_flag=Y merge_fundno=006281 actual_12b1=. max_12b1=. mgmt_fee=.
exp_ratio=0.000000 turn_ratio=. fiscal_yearend=. crsp_obj_cd=  si_obj_cd=  accrual_fund= 
sales_restrict=  wbrger_obj_cd=  policy=  lipper_class=  lipper_class_name=  lipper_obj_cd= 
lipper_obj_name=  lipper_asset_cd=  lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=793
qd=268 fundage=. per_cash2=0 _ERROR_=1 _N_=178
NOTE: Invalid argument to function LOG(0) at line 1046 column 15.
in1=1 wficn=401009 crsp_fundno=000024 summary_period2=A caldt=19901231 summary_period=A
nav_latest=9.9000000 nav_latest_dt=19901231 tna_latest=26.050 tna_latest_dt=19901231
yield=0.0001010101 div_ytd=0.00100000000 cap_gains_ytd=0.00000000000 nav_52w_h=. nav_52w_h_dt=.
nav_52w_l=. nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19901231 per_com=0
per_pref=0 per_conv=0 per_corp=0 per_muni=0 per_govt=0 per_oth=0 per_cash=0 per_bond=0 per_abs=.
per_mbs=. per_eq_oth=. per_fi_oth=. maturity=. maturity_dt=. cusip8=  crsp_portno=. crsp_cl_grp=.
fund_name=Axe-Core Int'l ADR Fund ticker=  ncusip=  mgmt_name=  mgmt_cd=  mgr_name= 
mgr_dt=19901101 adv_name=  open_to_inv=  retail_fund=  inst_fund=  m_fund=N index_fund_flag= 
vau_fund=N et_flag=  delist_cd=  header=0 first_offer_dt=19900101 end_dt=19920630 dead_flag=Y
merge_fundno=. actual_12b1=. max_12b1=. mgmt_fee=. exp_ratio=0.000000 turn_ratio=.
fiscal_yearend=. crsp_obj_cd=  si_obj_cd=  accrual_fund=  sales_restrict=  wbrger_obj_cd= 
policy=  lipper_class=  lipper_class_name=  lipper_obj_cd=  lipper_obj_name=  lipper_asset_cd= 
lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=781 qd=264 fundage=. per_cash2=0
_ERROR_=1 _N_=182
NOTE: Invalid argument to function LOG(0) at line 1046 column 15.
in1=1 wficn=100154 crsp_fundno=000025 summary_period2=A caldt=19921231 summary_period=A
nav_latest=17.6200000 nav_latest_dt=19921231 tna_latest=0.285 tna_latest_dt=19921231 yield=.
div_ytd=0.00000000000 cap_gains_ytd=0.00000000000 nav_52w_h=. nav_52w_h_dt=. nav_52w_l=.
nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19921231 per_com=0 per_pref=0
per_conv=0 per_corp=0 per_muni=0 per_govt=0 per_oth=0 per_cash=0 per_bond=0 per_abs=. per_mbs=.
per_eq_oth=. per_fi_oth=. maturity=. maturity_dt=. cusip8=  crsp_portno=. crsp_cl_grp=.
fund_name=Ambassador Funds:Established Co Gr/Retail A ticker=  ncusip=  mgmt_name=  mgmt_cd= 
mgr_name=  mgr_dt=19930501 adv_name=  open_to_inv=  retail_fund=  inst_fund=  m_fund=N
index_fund_flag=  vau_fund=N et_flag=  delist_cd=  header=0 first_offer_dt=19920101
end_dt=19950531 dead_flag=Y merge_fundno=021286 actual_12b1=. max_12b1=. mgmt_fee=.
exp_ratio=0.000000 turn_ratio=. fiscal_yearend=. crsp_obj_cd=  si_obj_cd=  accrual_fund= 
sales_restrict=  wbrger_obj_cd=  policy=  lipper_class=  lipper_class_name=  lipper_obj_cd= 
lipper_obj_name=  lipper_asset_cd=  lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=805
qd=272 fundage=. per_cash2=0 _ERROR_=1 _N_=185
NOTE: Invalid argument to function LOG(0) at line 1046 column 15.
in1=0 wficn=. crsp_fundno=000026 summary_period2=A caldt=19951229 summary_period=A
nav_latest=10.2100000 nav_latest_dt=19951229 tna_latest=0.202 tna_latest_dt=19951229
yield=0.0266405485 div_ytd=0.27200000000 cap_gains_ytd=0.05100000000 nav_52w_h=. nav_52w_h_dt=.
nav_52w_l=. nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19960329 per_com=0
per_pref=0 per_conv=0 per_corp=0 per_muni=97.4 per_govt=0 per_oth=0 per_cash=0.026 per_bond=0
per_abs=. per_mbs=. per_eq_oth=. per_fi_oth=. maturity=0.0 maturity_dt=19960329 cusip8= 
crsp_portno=. crsp_cl_grp=. fund_name=Achievement Fds Trust:Short Term Muni/Retail ticker= 
ncusip=  mgmt_name=SEI FINANCIAL MANAGEMENT CORP. mgmt_cd=  mgr_name=James A Schuck
mgr_dt=19950301 adv_name=  open_to_inv=  retail_fund=  inst_fund=  m_fund=N index_fund_flag= 
vau_fund=N et_flag=  delist_cd=L header=1 first_offer_dt=19950101 end_dt=19990331 dead_flag=Y
merge_fundno=. actual_12b1=0.002500 max_12b1=. mgmt_fee=. exp_ratio=0.010000 turn_ratio=.
fiscal_yearend=. crsp_obj_cd=IUS si_obj_cd=MSM accrual_fund=  sales_restrict=  wbrger_obj_cd= 
policy=  lipper_class=  lipper_class_name=  lipper_obj_cd=  lipper_obj_name=  lipper_asset_cd= 
lipper_tax_cd=  FIRST.crsp_fundno=0 LAST.crsp_fundno=0 md=841 qd=284 fundage=. per_cash2=1
_ERROR_=1 _N_=190
NOTE: Invalid argument to function LOG(0) at line 1046 column 15.
WARNING: Limit set by ERRORS= option reached.  Further errors of this type will not be printed.
in1=0 wficn=. crsp_fundno=000028 summary_period2=A caldt=19921231 summary_period=A
nav_latest=11.3500000 nav_latest_dt=19921231 tna_latest=11.986 tna_latest_dt=19921231
yield=0.0220264317 div_ytd=0.25000000000 cap_gains_ytd=0.00000000000 nav_52w_h=. nav_52w_h_dt=.
nav_52w_l=. nav_52w_l_dt=. unrealized_app_dep=. unrealized_app_dt=. asset_dt=19930331 per_com=0
per_pref=0 per_conv=0 per_corp=0 per_muni=90 per_govt=0 per_oth=0 per_cash=0.1 per_bond=0
per_abs=. per_mbs=. per_eq_oth=. per_fi_oth=. maturity=19.6 maturity_dt=19930331 cusip8= 
crsp_portno=. crsp_cl_grp=. fund_name=AMERICAN CAPITAL TXEX TRUST-INSURED MUNI/B ticker=ACTJX
ncusip=  mgmt_name=AMERICAN CAPITAL ASSET MANAGEMENT mgmt_cd=  mgr_name=BOB EVANS mgr_dt=19920701
adv_name=  open_to_inv=  retail_fund=  inst_fund=  m_fund=N index_fund_flag=  vau_fund=N
et_flag=  delist_cd=  header=0 first_offer_dt=19920101 end_dt=19950831 dead_flag=Y
merge_fundno=030993 actual_12b1=0.010000 max_12b1=. mgmt_fee=. exp_ratio=0.018200 turn_ratio=.
fiscal_yearend=. crsp_obj_cd=IU si_obj_cd=MIS accrual_fund=  sales_restrict=  wbrger_obj_cd= 
policy=  lipper_class=  lipper_class_name=  lipper_obj_cd=  lipper_obj_name=  lipper_asset_cd= 
lipper_tax_cd=  FIRST.crsp_fundno=1 LAST.crsp_fundno=0 md=805 qd=272 fundage=. per_cash2=1
_ERROR_=1 _N_=206
NOTE: MERGE statement has more than one data set with repeats of BY values.
NOTE: Missing values were generated as a result of performing an operation on missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      63 at 1:3           63 at 1:14          63 at 1:3           63 at 1:14
      24093 at 1046:15    63 at 1046:19       24093 at 1046:31    24093 at 1046:33
      453621 at 1047:17   453621 at 1047:51   453621 at 1048:24   
NOTE: Mathematical operations could not be performed at the following places. The results of the 
      operations have been set to missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      123002 at 1046:15   
NOTE: There were 44775 observations read from the data set WORK.MF_PORT.
NOTE: There were 2500116 observations read from the data set DATA.FUND_SUMMARY2.
NOTE: The data set WORK.FUNDCHARS has 1788316 observations and 16 variables.
NOTE: DATA statement used (Total process time):
      real time           1.69 seconds
      cpu time            1.65 seconds
      

1054  proc sort data=fundchars; by wficn date; run;

NOTE: There were 1788316 observations read from the data set WORK.FUNDCHARS.
NOTE: The data set WORK.FUNDCHARS has 1788316 observations and 16 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.66 seconds
      cpu time            0.92 seconds
      

1055  
1056  * Get hand-checked management name and code;
1057  proc import out      = std_mgmt_names
1058              datafile =
1058! 'C:/Users/hpham13/Projects/mf_activism/empirical/0_input/original/mff_names_dedup2023.xlsx'
1059              dbms     = xlsx
1060              replace;
1061  run;

NOTE: One or more variables were converted because the data type is not supported by the V9 
      engine. For more details, run with options MSGLEVEL=I.
NOTE: The import data set has 3132 observations and 7 variables.
NOTE: WORK.STD_MGMT_NAMES data set was successfully created.
NOTE: PROCEDURE IMPORT used (Total process time):
      real time           0.16 seconds
      cpu time            0.17 seconds
      

1062  
1063  proc sort data = std_mgmt_names nodupkey;
1064      by mgmt_name;
1065  run;

NOTE: There were 3132 observations read from the data set WORK.STD_MGMT_NAMES.
NOTE: 327 observations with duplicate key values were deleted.
NOTE: The data set WORK.STD_MGMT_NAMES has 2805 observations and 7 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.01 seconds
      cpu time            0.00 seconds
      

1066  
1067  * merge (hand-matched) corrected_mgmt_cd to fundchars ;
1068  proc sql;
1069      create table fundchars as
1070      select a.*, b.corrected_mgmt_cd
1071      from fundchars as a left join std_mgmt_names as b
1072      on a.mgmt_name=b.mgmt_name ;
WARNING: This CREATE TABLE statement recursively references the target table. A consequence of 
         this is a possible data integrity problem.
NOTE: Table WORK.FUNDCHARS created, with 1788316 rows and 17 columns.

1073  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           1.53 seconds
      cpu time            1.67 seconds
      

1074  
1075  * if corrected_mgmt_cd is missing, replace by original mgmt_cd and rename ;
1076  data fundchars; set fundchars;
1077      if missing(corrected_mgmt_cd) and not missing(mgmt_cd) then corrected_mgmt_cd = mgmt_cd
1077!  ;
1078      drop mgmt_cd;
1079      label corrected_mgmt_cd="Management Company Code";
1080      rename corrected_mgmt_cd= mgmt_cd ;
1081  run;

NOTE: There were 1788316 observations read from the data set WORK.FUNDCHARS.
NOTE: The data set WORK.FUNDCHARS has 1788316 observations and 16 variables.
NOTE: DATA statement used (Total process time):
      real time           0.35 seconds
      cpu time            0.36 seconds
      

1082  
1083  /* Merge data*/
1084  proc sql;
1085      create table returns_merged as
1086      select  a.*,
1087              b.crsp_fundno, b.fundage, b.turn_ratio, b.md, b.qd, b.mgmt_name, b.mgmt_cd,
1088              b.per_cash, b.per_muni, b.per_govt, b.per_cash2, (b.per_cash*a.tna) as mfcash,
1089              (b.per_cash2*a.tna) as mfcash2, b.nav_latest
1090      from    returns(where=(date between "&begdate"d and "&enddate"d)) as a left join
1090! fundchars as b
1091          on  a.wficn=b.wficn and a.qd=b.qd;
WARNING: Variable crsp_fundno already exists on file WORK.RETURNS_MERGED.
WARNING: Variable md already exists on file WORK.RETURNS_MERGED.
WARNING: Variable qd already exists on file WORK.RETURNS_MERGED.
NOTE: Table WORK.RETURNS_MERGED created, with 5249147 rows and 21 columns.

1092  
1093      create table MF_merged2 as
1094      select  a.*, b.tna label='TNA ($millions)', b.exp_ratio, b.rret
1095      from    MF_merged as a left join (select wficn, md, qd, tna, exp_ratio, rret
1096              from returns_merged ) as b
1097      on      a.wficn=b.wficn and a.md=b.md  ;
NOTE: Table WORK.MF_MERGED2 created, with 82720688 rows and 14 columns.

1098  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           22.55 seconds
      cpu time            27.50 seconds
      

1099  
1100  
1101  /* ******************************************************************************** */
1102  /* Part 5:   Compute ownership and define large holding funds   ******************* */
1103  /* ******************************************************************************** */
1104  proc sort
1105      data=MF_merged2 nodupkey
1106      out=MF_merged3 ;
1107      by   permno rdate wficn ;
1108  run;

NOTE: There were 82720688 observations read from the data set WORK.MF_MERGED2.
NOTE: 54937298 observations with duplicate key values were deleted.
NOTE: The data set WORK.MF_MERGED3 has 27783390 observations and 14 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           21.13 seconds
      cpu time            46.12 seconds
      

1109  
1110  * Get TSO;
1111  data MF_merged3;
1112      merge MF_merged3(in=a) price (in=b rename=(qdate=rdate));
1113      by permno rdate;
1114      if b and TSO>0;
1115      MFOR = shares_adj/TSO;
1116      label MFOR = "MFOwn MF-Firm-Level";
1117      format MFOR percentn8.4;
1118      if wficn ne . ;
1119  run;

NOTE: Missing values were generated as a result of performing an operation on missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      264722 at 1115:22   
NOTE: There were 27783390 observations read from the data set WORK.MF_MERGED3.
NOTE: There were 788968 observations read from the data set WORK.PRICE.
NOTE: The data set WORK.MF_MERGED3 has 20979804 observations and 22 variables.
NOTE: DATA statement used (Total process time):
      real time           6.33 seconds
      cpu time            5.71 seconds
      

1120  
1121  * Compute the firm weight in a mutual fund portfolio;
1122  proc sql;
1123      create table MF_merged3 as
1124      select *, (shares_adj*P)/sum(shares_adj*P) as fweight label="Firm weight" format
1124! percentn8.4
1125      from MF_merged3
1126      group by wficn, rdate
1127      order by wficn, rdate, permno;
NOTE: The query requires remerging summary statistics back with the original data.
WARNING: This CREATE TABLE statement recursively references the target table. A consequence of 
         this is a possible data integrity problem.
NOTE: Table WORK.MF_MERGED3 created, with 20979804 rows and 23 columns.

1128  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           25.07 seconds
      cpu time            37.28 seconds
      

1129  
1130  * Compute the change of ownership and Firm weight;
1131  proc sort data= MF_merged3; by wficn permno rdate; run;

NOTE: There were 20979804 observations read from the data set WORK.MF_MERGED3.
NOTE: The data set WORK.MF_MERGED3 has 20979804 observations and 23 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           8.09 seconds
      cpu time            15.85 seconds
      

1132  
1133  data MF_merged3; set MF_merged3;
1134      by wficn permno ;
1135      MFOR_l = lag(MFOR);
1136      fweight_l = lag(fweight);
1137      if first.permno then MFOR_l=.;
1138      if first.permno then fweight_l=.;
1139      changefweight = fweight - fweight_l ;
1140      changeMFOR = MFOR - MFOR_l ;
1141      /*assume no change for the first obs*/
1142      if first.permno then changefweight = 0 ;
1143      if first.permno then changeMFOR = 0 ;
1144      drop MFOR_l fweight_l ;
1145      format fweight changefweight MFOR changeMFOR percentn8.4;
1146  run;

NOTE: Missing values were generated as a result of performing an operation on missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      3068630 at 1139:29   3059047 at 1140:23   
NOTE: There were 20979804 observations read from the data set WORK.MF_MERGED3.
NOTE: The data set WORK.MF_MERGED3 has 20979804 observations and 25 variables.
NOTE: DATA statement used (Total process time):
      real time           5.53 seconds
      cpu time            5.28 seconds
      

1147  
1148  
1149  
1150  * ************************************************
1151  *  make an indicator for large holding (>=1%);
1152  * ************************************************;
1153  data MF_merged3_1; set MF_merged3;
1154      MFORpct = round(MFOR*100, 0.01);
1155      if MFORpct >= 1 then LargeMF = 1; else LargeMF = 0;
1156  run;

NOTE: There were 20979804 observations read from the data set WORK.MF_MERGED3.
NOTE: The data set WORK.MF_MERGED3_1 has 20979804 observations and 27 variables.
NOTE: DATA statement used (Total process time):
      real time           5.20 seconds
      cpu time            4.90 seconds
      

1157  
1158  proc sql;
1159      create table MF_merged3_1 as
1160      select *, max(LargeMF) as LargeMF2 label="Have LargeMF"
1161      from  MF_merged3_1
1162      where shares_adj > 0
1163      group by permno, rdate
1164      having LargeMF2=1
1165      order by permno, rdate, wficn;
NOTE: The query requires remerging summary statistics back with the original data.
WARNING: This CREATE TABLE statement recursively references the target table. A consequence of 
         this is a possible data integrity problem.
NOTE: Table WORK.MF_MERGED3_1 created, with 17219019 rows and 28 columns.

1166  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           25.95 seconds
      cpu time            36.39 seconds
      

1167  
1168  
1169  
1170  /* ******************************************************************************** */
1171  /* Part 6:  Get identifers and date from Compustat  ******************************* */
1172  /* ******************************************************************************** */
1173  %let vars=  gvkey fyearq fqtr fyr rdq conm datadate indfmt datafmt popsrc consol saleq atq;
1174  
1175  data fundq;
1176     set comp.fundq_1950_2021 (keep= &vars);
1177     where datadate between "&begdate"d and "&enddate"d ;
1178     if indfmt='INDL' and datafmt='STD' and popsrc='D' and consol='C';
1179     format endfyr begfyr date9.;
1180     endfyr= datadate;
1181     begfyr= intnx('month',endfyr,-11,'beg');
1182  run;

NOTE: There were 1240531 observations read from the data set COMP.FUNDQ_1950_2021.
      WHERE (datadate>='01MAR1995'D and datadate<='31DEC2021'D);
NOTE: The data set WORK.FUNDQ has 1236959 observations and 15 variables.
NOTE: DATA statement used (Total process time):
      real time           3.90 seconds
      cpu time            0.43 seconds
      

1183  proc sort; by gvkey endfyr; run;

NOTE: There were 1236959 observations read from the data set WORK.FUNDQ.
NOTE: The data set WORK.FUNDQ has 1236959 observations and 15 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.38 seconds
      cpu time            0.50 seconds
      

1184  
1185  
1186  /* Make a link GVKEYS to CRSP-PERMNO; */
1187  proc sql;
1188    create table comp_lnk as select *
1189    from fundq as a, lnk.ccmxpf_lnkhist as b
1190    where a.gvkey = b.gvkey and
1191    b.LINKTYPE in ("LU","LC","LD","LN","LS","LX") and
1192    (b.LINKDT <= a.endfyr or b.LINKDT = .B) and (a.endfyr <= b.LINKENDDT or b.LINKENDDT = .E)
1192! ;
WARNING: Variable GVKEY already exists on file WORK.COMP_LNK.
NOTE: Table WORK.COMP_LNK created, with 808675 rows and 22 columns.

1193  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.31 seconds
      cpu time            0.29 seconds
      

1194  
1195  
1196  /* ******************************************************************************** */
1197  /* Part 7: Make the InformedTradeGrap variable  *********************************** */
1198  /* ******************************************************************************** */
1199  proc sql;
1200      create view MF_merged_comp1 as
1201      select a.gvkey, a.datadate, a.rdq, b.*
1202      from comp_lnk as a join MF_merged3_1 as b
1203      on a.lpermno=b.permno and
1204         year(a.datadate)=year(b.rdate) and qtr(a.datadate)=qtr(b.rdate);
NOTE: SQL view WORK.MF_MERGED_COMP1 has been defined.
1205  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

1206  
1207  proc sort
1208      data=MF_merged_comp1
1209      out=MF_merged_comp nodupkey ;
1210      by permno rdate wficn ;
1211  run;

NOTE: There were 17535940 observations read from the data set WORK.MF_MERGED_COMP1.
NOTE: 373064 observations with duplicate key values were deleted.
NOTE: The data set WORK.MF_MERGED_COMP has 17162876 observations and 31 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           14.80 seconds
      cpu time            17.98 seconds
      

1212  
1213  * read the abnormal return data;
1214  data abret_car;
1215      set rawdata.abret013024_capm;
1216  run;

NOTE: There were 816855 observations read from the data set RAWDATA.ABRET013024_CAPM.
NOTE: The data set WORK.ABRET_CAR has 816855 observations and 9 variables.
NOTE: DATA statement used (Total process time):
      real time           0.20 seconds
      cpu time            0.01 seconds
      

1217  proc sort data=abret_car nodupkey; by gvkey rdq; run;

NOTE: There were 816855 observations read from the data set WORK.ABRET_CAR.
NOTE: 9675 observations with duplicate key values were deleted.
NOTE: The data set WORK.ABRET_CAR has 807180 observations and 9 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.12 seconds
      cpu time            0.29 seconds
      

1218  
1219  * lead abnormal returns by 1 quarter;
1220  proc expand data = abret_car out=abret_car method=none ;
1221      by gvkey ;
1222      id rdq;
1223      convert abret = abret_lead / transformout = (lead 1);
1224      convert car   = car_lead / transformout = (lead 1);
1225  run;

NOTE: The data set WORK.ABRET_CAR has 807180 observations and 11 variables.
NOTE: PROCEDURE EXPAND used (Total process time):
      real time           1.28 seconds
      cpu time            1.03 seconds
      

1226  
1227  data abret_car;
1228      set abret_car;
1229      label abret_lead="Abret next Earnings Ann";
1230      label car_lead="CAR[-1,1] next Earnings Ann";
1231  run;

NOTE: There were 807180 observations read from the data set WORK.ABRET_CAR.
NOTE: The data set WORK.ABRET_CAR has 807180 observations and 11 variables.
NOTE: DATA statement used (Total process time):
      real time           0.05 seconds
      cpu time            0.04 seconds
      

1232  
1233  
1234  * merge Abnormal returns to MFF data;
1235  proc sql;
1236      create table MF_merged_comp as
1237      select a.*, b.car, b.abret, b.car_lead, b.abret_lead, b.logret, b.fyear
1238      from MF_merged_comp as a join abret_car as b
1239      on a.gvkey=b.gvkey and a.rdq=b.rdq;
WARNING: This CREATE TABLE statement recursively references the target table. A consequence of 
         this is a possible data integrity problem.
NOTE: Table WORK.MF_MERGED_COMP created, with 16797121 rows and 37 columns.

1240  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           6.81 seconds
      cpu time            6.31 seconds
      

1241  
1242  /* treat outliers*/
1243  %let winsVars2 = car_lead abret_lead changeMFOR changefweight ;
1244  %winsor(dsetin=work.MF_merged_comp, dsetout=work.MF_merged_comp, byvar=fyear,
1244! vars=&winsVars2, type=winsor, pctl=1 99);

NOTE: There were 16797121 observations read from the data set WORK.MF_MERGED_COMP.
NOTE: The data set WORK.XTEMP has 16797121 observations and 37 variables.
NOTE: DATA statement used (Total process time):
      real time           4.81 seconds
      cpu time            4.50 seconds
      


NOTE: There were 16797121 observations read from the data set WORK.XTEMP.
NOTE: The data set WORK.XTEMP has 16797121 observations and 37 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           8.73 seconds
      cpu time            12.96 seconds
      


NOTE: The data set WORK.XTEMP_PCTL has 28 observations and 9 variables.
NOTE: PROCEDURE UNIVARIATE used (Total process time):
      real time           41.13 seconds
      cpu time            37.76 seconds
      


WARNING: The variable xbyvar in the DROP, KEEP, or RENAME list has never been referenced.
NOTE: There were 16797121 observations read from the data set WORK.XTEMP.
NOTE: There were 28 observations read from the data set WORK.XTEMP_PCTL.
NOTE: The data set WORK.MF_MERGED_COMP has 16797121 observations and 37 variables.
NOTE: DATA statement used (Total process time):
      real time           6.73 seconds
      cpu time            6.07 seconds
      

1245  
1246  data MF_merged_comp;
1247      set MF_merged_comp;
1248      format car abret car_lead abret_lead comma8.5;
1249      stkpick1 = (changeMFOR * 100)    * (car_lead * 100);
1250      stkpick2 = (changefweight * 100) * (car_lead * 100);
1251      if stkpick1 ne .;
1252  run;

NOTE: Missing values were generated as a result of performing an operation on missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      160169 at 1249:50   1192 at 1250:31     160142 at 1250:50   
NOTE: There were 16797121 observations read from the data set WORK.MF_MERGED_COMP.
NOTE: The data set WORK.MF_MERGED_COMP has 16636952 observations and 39 variables.
NOTE: DATA statement used (Total process time):
      real time           5.26 seconds
      cpu time            4.84 seconds
      

1253  
1254  
1255  * Calcualte funds' metric;
1256  proc sort data = MF_merged_comp; by permno rdate; run;

NOTE: There were 16636952 observations read from the data set WORK.MF_MERGED_COMP.
NOTE: The data set WORK.MF_MERGED_COMP has 16636952 observations and 39 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           11.13 seconds
      cpu time            15.70 seconds
      

1257  
1258  proc means data=MF_merged_comp noprint;
1259      where shares_adj>0 ;
1260      by permno rdate;
1261      var shares_adj;
1262      output out=MFO_Metrics_comp (drop=_freq_ _type_)
1263             n=NumOwners max(NumInst)=NumInst
1264             sum(shares_adj)=MFO_TOTAL
1265             USS(shares_adj)=MFO_SS;
1266  run;

NOTE: There were 16636952 observations read from the data set WORK.MF_MERGED_COMP.
      WHERE shares_adj>0;
NOTE: The data set WORK.MFO_METRICS_COMP has 313407 observations and 6 variables.
NOTE: PROCEDURE MEANS used (Total process time):
      real time           5.22 seconds
      cpu time            4.84 seconds
      

1267  * compute MFOC_HHI;
1268  data MFO_Metrics_comp;
1269      set MFO_Metrics_comp;
1270      by permno rdate;
1271      MFOC_HHI = MFO_SS/(MFO_TOTAL**2);
1272      label MFO_TOTAL  = "Sum of all shares, Total - Adjusted";
1273      label MFOC_HHI   = "MFO Concentration - Herfindahl- Hirschman Index";
1274      label MFO_SS     = "Sum of squares of shares adjusted";
1275      label NumOwners  = "Number of S12 Filers of a firm Each Quarter";
1276      label NumInst    = "Total Number of S12 Filers During Each Quarter";
1277  run;

NOTE: There were 313407 observations read from the data set WORK.MFO_METRICS_COMP.
NOTE: The data set WORK.MFO_METRICS_COMP has 313407 observations and 7 variables.
NOTE: DATA statement used (Total process time):
      real time           0.03 seconds
      cpu time            0.01 seconds
      

1278  * Make a time series data, will merge to the final output late;
1279  data MFO_TimeSeries_comp;
1280      merge MFO_Metrics_comp(in=a) Price (in=b rename=(qdate=rdate));
1281      by permno rdate;
1282      if b and TSO>0;
1283      if a and MFO_TOTAL>0;
1284      MFOR = MFO_TOTAL/TSO;
1285      if missing(MFOR) then MFOR=0;
1286      MFO_MISSING = (not a);
1287      MFO_G1      = (MFOR>1);
1288      label MFOR = "Mutual Fund Ownership Ratio";
1289      label MFO_MISSING = "Missing (or NA) 13-F Data";
1290      label MFO_G1 = "MFOR % > 1";
1291      drop CFACSHR;
1292      format MFO_TOTAL NumOwners comma16. MFOR MFOC_HHI percentn8.2;
1293  run;

NOTE: There were 313407 observations read from the data set WORK.MFO_METRICS_COMP.
NOTE: There were 788968 observations read from the data set WORK.PRICE.
NOTE: The data set WORK.MFO_TIMESERIES_COMP has 313407 observations and 17 variables.
NOTE: DATA statement used (Total process time):
      real time           0.23 seconds
      cpu time            0.12 seconds
      

1294  
1295  * We take the average metrics by group;
1296  proc sql;
1297      create table MF_merged_comp2 as
1298      select   gvkey, datadate, rdq, car_lead, car,
1299               permno, rdate, md, qd, LargeMF,
1300               avg(stkpick1) as avg_stkpick1,
1301               avg(stkpick2) as avg_stkpick2,
1302               count(wficn)  as NumInst,
1303               avg(MFOR)     as avgMFOR,
1304               sum(MFOR)     as sumMFOR
1305      from     MF_merged_comp
1306      group by permno, rdate, LargeMF
1307      order by permno, rdate, LargeMF;
NOTE: The query requires remerging summary statistics back with the original data.
NOTE: Table WORK.MF_MERGED_COMP2 created, with 16636952 rows and 15 columns.

1308  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           10.92 seconds
      cpu time            13.73 seconds
      

1309  
1310  data MF_merged_comp2; set MF_merged_comp2;
1311      if LargeMF=1 then _stkpick1_Large = avg_stkpick1;
1312      if LargeMF=0 then _stkpick1_Small = avg_stkpick1;
1313  run;

NOTE: There were 16636952 observations read from the data set WORK.MF_MERGED_COMP2.
NOTE: The data set WORK.MF_MERGED_COMP2 has 16636952 observations and 17 variables.
NOTE: DATA statement used (Total process time):
      real time           2.22 seconds
      cpu time            2.14 seconds
      

1314  proc sql;
1315      create table MF_merged_comp2 as
1316      select *
1317             , max(_stkpick1_Large) as stkpick1_Large
1318             , max(_stkpick1_Small) as stkpick1_Small
1319      from MF_merged_comp2
1320      group by permno, rdate
1321      order by permno, rdate, LargeMF;
NOTE: The query requires remerging summary statistics back with the original data.
WARNING: This CREATE TABLE statement recursively references the target table. A consequence of 
         this is a possible data integrity problem.
NOTE: Table WORK.MF_MERGED_COMP2 created, with 16636952 rows and 19 columns.

1322  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           15.01 seconds
      cpu time            20.50 seconds
      

1323  data MF_merged_comp2; set MF_merged_comp2;
1324      drop _stkpick1_Large _stkpick1_Small;
1325  run;

NOTE: There were 16636952 observations read from the data set WORK.MF_MERGED_COMP2.
NOTE: The data set WORK.MF_MERGED_COMP2 has 16636952 observations and 17 variables.
NOTE: DATA statement used (Total process time):
      real time           2.75 seconds
      cpu time            2.39 seconds
      

1326  
1327  * compute the difference between LargeMF(=1) and smallMF (=0);
1328  proc sort data=MF_merged_comp2 nodupkey; by permno rdate LargeMF ; run;

NOTE: There were 16636952 observations read from the data set WORK.MF_MERGED_COMP2.
NOTE: 16022068 observations with duplicate key values were deleted.
NOTE: The data set WORK.MF_MERGED_COMP2 has 614884 observations and 17 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           2.42 seconds
      cpu time            4.65 seconds
      

1329  data MF_merged_comp2;
1330      set MF_merged_comp2;
1331      by permno rdate;
1332      Relstkpick1 = dif(avg_stkpick1);
1333      if first.permno or first.rdate then Relstkpick1 = .;
1334  run;

NOTE: There were 614884 observations read from the data set WORK.MF_MERGED_COMP2.
NOTE: The data set WORK.MF_MERGED_COMP2 has 614884 observations and 18 variables.
NOTE: DATA statement used (Total process time):
      real time           0.12 seconds
      cpu time            0.12 seconds
      

1335  
1336  proc sort data=MF_merged_comp2 nodupkey; by permno rdate LargeMF ; run;

NOTE: There were 614884 observations read from the data set WORK.MF_MERGED_COMP2.
NOTE: 0 observations with duplicate key values were deleted.
NOTE: The data set WORK.MF_MERGED_COMP2 has 614884 observations and 18 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.16 seconds
      cpu time            0.18 seconds
      

1337  data MF_merged_comp2;
1338      set MF_merged_comp2;
1339      by permno rdate;
1340      Relstkpick2 = dif(avg_stkpick2);
1341      if first.permno or first.rdate then Relstkpick2 = .;
1342  run;

NOTE: There were 614884 observations read from the data set WORK.MF_MERGED_COMP2.
NOTE: The data set WORK.MF_MERGED_COMP2 has 614884 observations and 19 variables.
NOTE: DATA statement used (Total process time):
      real time           0.11 seconds
      cpu time            0.10 seconds
      

1343  proc sort data=MF_merged_comp2 nodupkey; by permno rdate  LargeMF ; run;

NOTE: There were 614884 observations read from the data set WORK.MF_MERGED_COMP2.
NOTE: 0 observations with duplicate key values were deleted.
NOTE: The data set WORK.MF_MERGED_COMP2 has 614884 observations and 19 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.19 seconds
      cpu time            0.26 seconds
      

1344  
1345  data MF_merged_comp2; set MF_merged_comp2;
1346      if LargeMF = 0 then _avgMFORsmall = avgMFOR; else _avgMFORsmall = 0 ;
1347      if LargeMF = 1 then _avgMFORlarge = avgMFOR; else _avgMFORlarge = 0 ;
1348      if LargeMF = 0 then _sumMFORsmall = sumMFOR; else _sumMFORsmall = 0 ;
1349      if LargeMF = 1 then _sumMFORlarge = sumMFOR; else _sumMFORlarge = 0 ;
1350      if LargeMF = 0 then _NumInstsmall = NumInst; else _NumInstsmall = 0 ;
1351      if LargeMF = 1 then _NumInstlarge = NumInst; else _NumInstlarge = 0 ;
1352  run;

NOTE: There were 614884 observations read from the data set WORK.MF_MERGED_COMP2.
NOTE: The data set WORK.MF_MERGED_COMP2 has 614884 observations and 25 variables.
NOTE: DATA statement used (Total process time):
      real time           0.10 seconds
      cpu time            0.10 seconds
      

1353  
1354  * collapse data to the firm-quarter ;
1355  proc sql;
1356      create table MF_merged_comp2 as
1357      select *, max(_avgMFORsmall) as avgMFORsmall,
1358                max(_avgMFORlarge) as avgMFORlarge,
1359                max(_sumMFORsmall) as sumMFORsmall,
1360                max(_sumMFORlarge) as sumMFORlarge,
1361                max(_NumInstsmall) as NumInstsmall,
1362                max(_NumInstlarge) as NumInstlarge
1363      from MF_merged_comp2
1364      group by permno, rdate;
NOTE: The query requires remerging summary statistics back with the original data.
WARNING: This CREATE TABLE statement recursively references the target table. A consequence of 
         this is a possible data integrity problem.
NOTE: Table WORK.MF_MERGED_COMP2 created, with 614884 rows and 31 columns.

1365  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.57 seconds
      cpu time            0.53 seconds
      

1366  
1367  data MF_merged_comp3; set MF_merged_comp2;
1368      drop avg_stkpick1 avg_stkpick2 LargeMF;
1369      if Relstkpick2 eq . then delete;
1370      ryear = year(rdate);
1371      format avgMFORsmall avgMFORlarge sumMFORsmall sumMFORlarge percent8.2;
1372      drop _avgMFORsmall _avgMFORlarge _sumMFORsmall _sumMFORlarge _NumInstsmall
1372! _NumInstlarge NumInst avgMFOR sumMFOR;
1373  run;

NOTE: There were 614884 observations read from the data set WORK.MF_MERGED_COMP2.
NOTE: The data set WORK.MF_MERGED_COMP3 has 301389 observations and 20 variables.
NOTE: DATA statement used (Total process time):
      real time           0.05 seconds
      cpu time            0.06 seconds
      

1374  proc sort data=MF_merged_comp3 nodupkey; by permno rdate; run;

NOTE: There were 301389 observations read from the data set WORK.MF_MERGED_COMP3.
NOTE: 0 observations with duplicate key values were deleted.
NOTE: The data set WORK.MF_MERGED_COMP3 has 301389 observations and 20 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.13 seconds
      cpu time            0.12 seconds
      

1375  
1376  proc sort data=MF_merged_comp3; by permno qd md; run;

NOTE: There were 301389 observations read from the data set WORK.MF_MERGED_COMP3.
NOTE: The data set WORK.MF_MERGED_COMP3 has 301389 observations and 20 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.10 seconds
      cpu time            0.12 seconds
      

1377  data MF_merged_comp4;
1378      retain gvkey datadate rdq permno rdate ryear;
1379      set MF_merged_comp3;
1380      by permno qd md;
1381      if last.qd;
1382  run;

NOTE: There were 301389 observations read from the data set WORK.MF_MERGED_COMP3.
NOTE: The data set WORK.MF_MERGED_COMP4 has 301389 observations and 20 variables.
NOTE: DATA statement used (Total process time):
      real time           0.07 seconds
      cpu time            0.07 seconds
      

1383  
1384  proc sql;
1385      create table MF_merged_comp4 as
1386      select a.*, b.NumOwners, b.MFOR, b.MFOC_HHI, b.me
1387      from MF_merged_comp4 as a left join MFO_TimeSeries_comp as b
1388      on  a.permno=b.permno and a.rdate=b.rdate
1389      order by a.permno, a.rdate;
WARNING: This CREATE TABLE statement recursively references the target table. A consequence of 
         this is a possible data integrity problem.
NOTE: Table WORK.MF_MERGED_COMP4 created, with 301389 rows and 24 columns.

1390  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.37 seconds
      cpu time            0.35 seconds
      

1391  
1392  /* delete unneeded datasets */
1393  proc datasets nowarn nolist nodetails;
1394        delete MF_merged_comp MF_merged_comp1 MF_merged_comp2 MF_merged_comp3 abret_car
1394! MFO_Metrics_comp MFO_TimeSeries_comp MFO_Metrics3 MFO_TimeSeries3 ;
1395  run;

NOTE: Deleting WORK.MF_MERGED_COMP (memtype=DATA).
NOTE: Deleting WORK.MF_MERGED_COMP2 (memtype=DATA).
NOTE: Deleting WORK.MF_MERGED_COMP3 (memtype=DATA).
NOTE: Deleting WORK.ABRET_CAR (memtype=DATA).
NOTE: Deleting WORK.MFO_METRICS_COMP (memtype=DATA).
NOTE: Deleting WORK.MFO_TIMESERIES_COMP (memtype=DATA).
1395!      quit;

NOTE: PROCEDURE DATASETS used (Total process time):
      real time           0.56 seconds
      cpu time            0.56 seconds
      

1396  
1397  data save.stkpick031224_mf;
1398      set MF_merged_comp4;
1399  run;

NOTE: There were 301389 observations read from the data set WORK.MF_MERGED_COMP4.
NOTE: The data set SAVE.STKPICK031224_MF has 301389 observations and 24 variables.
NOTE: DATA statement used (Total process time):
      real time           0.03 seconds
      cpu time            0.03 seconds
      

1400  
1401  
1402  proc printto;
1403  run;

